What is the name of your state? Texas
If you are at a boarding school/residential treatment center what is the age that you can legally leave without anyones consent? Is it 17 (because you are an adult at 17 in Texas) or is it 18?
A person is not a legal adult until they are 18.
More importantly, how did this person come to be in the residential treatment center?
If it was through the courts, or if the person's parents placed them there, no they cannot leave without permission until they are either 18, or until the court decides.
If this person admitted themself, without any court action, and without parents' assistance, it MIGHT be possible for them to leave. However, it will also come down to if the Dr feels they are stable enough to be discharged.