Every year before a Presidential Election, I get calls from clients asking when & how they can become citizens. Assuming that you do not have a parent who is a US Citizen, the following applies with regards to “when” you can file.
1) If you gained permanent residency (your Greencard) through marriage to a US Citizen (filed an I-130), you can file for your Citizenship by filing an N-400. Technically you can file after you have been a permanent resident for 2 years and 9 months since you receive Permanent Resident status (Remember, in almost all marriage based petitions, you are required to remove the conditions, and this must be approved prior receiving Citizenship).
2) If you gained Permanent Residency any other way, you can file after being a permanent resident for five (5) years.
A side note: If you’ve had any criminal issues, or have previously claimed to be a US Citizen, it is very important that you discuss this with a competent Immigration Lawyer BEFORE filing.