Yes, you can be committed to a mental hospital against your will if you meet the criteria set forth by the state in which you live. These criteria often include the requirement that you must present a danger, either to yourself or others, before you can be committed. If you are feeling suicidal and it is believed that you are in danger of hurting yourself this would fall under this umbrella. Other criteria that may be looked at include such factors as whether you are able to take care of yourself and whether you are in need of treatment for your mental illness.
Although the exact process varies from state-to-state, each state has procedures in place that prevent you from being detained without just cause, such as requirements for medical certification or judicial approval. There are also time limits on how long you can be held.
Who can initiate the process of having you committed also varies from state-to-state and depends upon what type of commitment is sought.
An emergency detention, such as might be necessary in a situation where you have made an attempt to hurt yourself, can generally be requested by anyone who has witnessed the situation that you are in, such as friends, family or the police. Even though almost anyone can initiate the process, states do generally require either medical evaluation or court approval in order to ensure that you meet that particular state's criteria.
Emergency detentions are most often limited to around 3-5 days, although it can vary from anywhere between 24 hours to 20 days, depending on your state.
Commitments for longer periods of time generally have more stringent requirements than an emergency detention, but again are for limited periods of time and cannot be extended without the proper procedures being followed.
To learn more about your own state's laws regarding involuntary commitment, I would recommend consulting a site like Treatment Advocacy Center, which provides a state-by-state review of all relevant laws.