You become eligible for regular naturalization when you have been living in Hungary for at least 8 years, and also have an address card (meaning the plastic address card, not the simple, paper-based accommodation slip). When you can apply for an address card depends on your status in Hungary: third-country nationals must apply for permanent residency first, which is available after at least three years of initial residency; EEA citizens can apply for the address card together with their registration card.
Before applying for Hungarian citizenship, you must also demonstrate that you have sufficient knowledge of Hungarian history and culture. This is usually done by passing an exam on “constitutional studies” in Hungarian, which has both a written and an oral part. However, applicants may be exempt from this exam either if they are above 60 years of age, or if they have graduated from a high-school or higher-education institution where the language of instruction is Hungarian.
Applicants must also have a clean criminal record, they cannot be under prosecution, and they should not pose any threat to national security.