In most cases you have to apply for admission to the new program, as most American universities admit by department or college for graduate studies.
It is much more difficult to switch from one PhD program to another, as you not only have to apply again and be admitted by the department offering the degree, but you must take the PhD qualifying exam in your new program. Also, depending on how closely aligned the fields are, coursework taken in your original program may or may not be applicable to your new program. It is generally easier to switch Master's programs but still will normally require a new application.
Many departments or colleges limit the number of courses you can apply to a graduate degree taken in another program. In the Master's program I teach in, it is three, and they must be courses that would have reasonable application to our degree. We routinely accept students changing programs, unless their academic performance was sub-par in their previous program, i.e. any Cs, even if their GPA is satisfactory, and/or any course failures.