The first naturalization act, passed by congress in 1790, required 2 years of residence before an immigrant could become a citizen. In 1785, it was increased to 5 years. The 20th century saw various laws passed that changed to residency period between 5 and 7 years.
Ellis Island was opened for immigration in 1882, nearly a century after initial residency term requirements for qualifications for U.S. citizenship.
Source. and other source