The primary reason for involuntary commitment is that a person poses a threat to themselves or others.
This is usually intentionally broad, but can be taken to mean suicidal, delusional or homicidal tendencies, or other personality disorders that make a person a threat.
There are usually provisions for holding a person for a limited period of time in emergency situations - for example, if they have recently attempted to commit suicide.
Each State will have different standards required to have a person involuntarily committed beyond this emergency period. However, in general, if a person is a danger to themselves or others unable to provide for themselves, and will continue to be without assistance, then they will meet the criteria for involuntary commitment.
This chart has some elaborated and detailed information, state-by-state.