They are legal in 40 out of the 50 states and are illegal in 10 including California, Colorado, Illinois, Minnesota, Oklahoma, South Carolina, Tennessee, Texas, Utah, and Virginia.
Penalties if caught are generally pretty minor, akin to a fix-it ticket, like having tint that’s too dark or not running a front plate if you’re supposed to.