It's Kind of a Funny Story
(2010)

Craig (Keir Gilchrist), feeling that he may be suicidal; convinces an E.R. Doctor to admit him into the Psychiatric Ward.

After being admitted, he immediately realizes his mistake, when he learns that he is required to stay for a minimum of 5 days but could be held there indefinitely.

After he gets checked in and acclimated, he meets many odd people; the main two being Bobby (Zach Galifianakis) [6 Suicide attempts] and Noell (Emma Roberts) [a Cutter].

Over the 5 Days, he realizes that the crush that he has on his Best Friends Girlfriend is just a crush and he actually has true feelings for Noell.
Bobby completes the program the same day as Craig, but leaves before Craig has a chance to say goodbye. (It is unclear if they ever saw or spoke to each other again.)

Craig leaves the Ward, knowing that he is no different than anyone else and that the way he feels is actually just normal thoughts and fears for a 16 Year Old.

Noell is released a few weeks after Craig and the film ends with them together and happy; both in life and their new relationship.

Thanks Alan!