Psychiatric hospitals, or inpatient psychiatric units in general hospitals, are intended to help people who are acutely ill.
Mental illness along with active plans to harm self or others, psychosis
, severe depression
with inability to look after self, mania
in bipolar disorder
, etc are all possible situations that might need inpatient treatment. There are longer term units for more severe illness.