From The National Parks Service:

From the 1880s into the 1960s, a majority of American states enforced segregation through "Jim Crow" laws (so called after a black character in minstrel shows). From Delaware to California, and from North Dakota to Texas, many states (and cities, too) could impose legal punishments on people for consorting with members of another race. The most common types of laws forbade intermarriage and ordered business owners and public institutions to keep their black and white clientele separated.
Here is a sample of laws from various states: