You need to be a permanent resident card (green card) holder to be eligible to apply for citizenship.
In normal circumstances, an immigrant should be a permanent resident for five years to be eligible for citizenship. If you are married to a US citizen, then it is three years of permanent residency.It is that you have to be in marriage to a U.S citizen and should be living with that U.S citizen for the past 3 three years of your permanent residency for the criteria to be applicable to you.
Current regulations do allow a person to start the application process ninety days before they fulfill their residency requirement.