Until 1882, the United States had no immigration laws at all, but it had rules about the who and how of immigrants becoming citizens.
Congress passed the Chinese Exclusion Act in 1882. (The expression "Yellow Peril" became popular at this time.) Another 1882 law banned "lunatics" and infectious disease carriers. The Anarchist Exclusion Act of 1901 excluded known anarchist agitators. A literacy requirement was added in 1917.
In 1921, the Emergency Quota Act established immigration quotas based on the number of foreign-born residents of each nationality living in the United States as of the 1910 census.
In the Immigration Act of 1924, the census used was changed to that of 1890. This greatly reduced the number of Southern and Eastern European immigrants.
In 1932 the U.S. shut down immigration during the Great Depression. The policy included the coerced deportation of between 500,000 and 2 million Mexican Americans, mostly citizens.
The Immigration and Nationality Act of 1952 revised the quotas, basing them on the 1920 census.
For the stuff I left out and the complicated history since 1952, see https://en.wikipedia.org/wiki/History_of_laws_concerning_immigration_and_naturalization_in_the_United_States