In re Gault
Every state has its own laws about their juvenile courts.  However, usually, if the judge rules that the child is "delinquent," the judge can make that child a "ward of the court."  This means the judge is putting the court in charge of the child, and taking that power away from the child's parents.  For the worst crimes, the court can decide to put the child in a special school, juvenile prison, or other program away from home, and keep them there until they turn 21.