From 1802 to 1868 an individual had to prove residency in a state for one year and in the country for five years. A declaration of intention had to be filed at least two years before the final papers or petition could be filed.
For details on the different requirements at different time periods, see
http://naturalizationrecords.com/usa/residency.shtml