Only Texas has addressed that issue by law, but with significant
restrictions. In all other states, it's a case by case basis, with
the Judge reviewing the maturity of the child, and their reasons.
The judge will then render a decision she thinks is in the child's
best interest.
See related question.