Person applying for citizenship must show good moral character for 5 years (or for a spouse of a United States citizen, 3 years, or for person in the military, 1 year) prior to filing and up to the time of admission. For example, a person convicted of a crime of moral turpitude, multiple crimes or a drug crime is not eligible for naturalization.
It is important to note that a person must be denied citizenship not only if he is convicted, but if he admits facts that constitute certain crimes. 8 C.F.R. Section 316.10(b)(2)(iv). Expunged records are still relevant to a Good Moral Character determination.
People with criminal records should always consult an immigration attorney before filing the citizenship application.