There's no single answer to how old a child has to be to stay in a car alone. Laws vary significantly by state and even sometimes by municipality.
Some states have no specific laws, leaving it up to parental judgment. Others have laws specifying a minimum age, and the age limit can range from as young as 6 to as old as 14. Many states also consider factors beyond just age, such as the child's maturity level, the length of time the child is left alone, and the environment (e.g., is the car locked, is it a safe location?).
It's crucial to check your state's laws and local ordinances regarding leaving children unattended in vehicles. Even if a law doesn't exist, leaving a child unsupervised in a car can be considered neglect and have legal consequences.