When would a person need to go to a mental hospital?

When in danger. When someone is behaving in a manner that endangers themselves or others they are admitted to an inpatient facility that can help. This often includes suicidal or homicidal threats or behaviors.