Dependents of certain non-immigrant visa holders (i.e., A, G, H, L, O, P, and R) are eligible to study in the U.S. as long as their spouse or parent maintains valid visa status. Your status is tied to that of your parent or spouse. If/when the primary visa holder leaves the country, you must also leave the country or apply for a change to an appropriate student status.
Definition of dependent for visa purposes:
For all visa categories except A and G: A dependent child loses his/her dependent status upon turning 21 years old. Therefore, you must change your status to an appropriate visa category prior to your 21st birthday if you wish to remain in the United States;
For A & G Status: Children of parents in either A or G status are considered dependents for visa purposes if they are unmarried and not a part of some other, independent household. College students who live near campus while in school are not considered to be in a separate household for these purposes. NOTE: If your parent is in the United States in valid A or G status and you are unmarried, you may NOT change to a different visa category even if you would like to do so.