The United States Constitution says nothing about immigration. Its creators left it to the states to control how many new people came in.
New York receives the most immigrants. It took the lead in setting rules. The first rules were meant to keep out those who could not support themselves. They also kept out people with contagious diseases.
As immigration grew, the federal government took more responsibility. The first national law was enacted in 1875. It mostly kept out criminals. After a surge of immigrants between 1880 and 1920, the government set quotas from each country. These were based on how many people of that ancestry were already in the U.S. The policy helped northern Europeans. But it cut immigration from other nations. Since then, immigration limits have gone up and down, depending in part on the U.S. economy. One result of strict regulation has been a large population of illegal aliens. They cannot immigrate legally. But they still want a better life. So they manage to enter the U.S. somehow. Most live in fear of being sent back to their native countries.