Most green card holders can apply for US citizenship (naturalization) with Form N-400:
5 years after the date on your green card ("Resident since").
3 years if you have been married to and living with a US citizen for those 3 years, and the spouse was a citizen the whole time.
You may file up to 90 days early. USCIS has an online early filing calculator.
For refugees, the green card date goes back to arrival, so the clock starts then.
You must live in the US continuously during those years.
A trip of more than 6 months but less than 1 year: USCIS assumes you broke your residence, unless you can show you kept your life here (job, home, taxes, family).
A trip of 1 year or more: your residence is broken. The clock usually starts again.
A re-entry permit does not stop this.
You must also have been inside the US for at least half the time: 30 months of the 5 years, or 18 months of the 3 years. Keep a list of every trip with dates.
Other requirements, briefly
Living 3 months in your state or USCIS district before filing.
Good moral character: pay taxes, follow the law, pay child support, register with Selective Service if required.
An English test and a civics test (US history and government) at the interview. Some older people with long residence can take the civics test in their language.
$710 online or $760 on paper. A reduced fee is possible for some households with lower income (paper only).
Write down every trip abroad with exact dates.
File taxes every year as a resident.
Keep proof of your life here: leases, pay stubs, tax returns.
Counting from the arrival date instead of the green card date (except refugees).
A long work trip that breaks residence without anyone noticing.
Old arrests or tax debts that were not resolved. Talk to an attorney first.