Generally, you need to reside in the US for a continuous period of either 3 or 5 years before applying for naturalization. The exact duration depends on specific circumstances, such as your marital status and your spouse’s citizenship.