Larry Crowne (Tom Hanks), a middle-aged Navy veteran, is fired from his job at a big-box store due to a lack of college education, despite his seniority and exemplary work. Larry, who is divorced and lives alone, cannot find a job and could lose his house. Larry's neighbor, Lamar (Cedric the Entertainer), advises him to enroll in the local community college and get an education.
Subsisting on unemployment benefits and unable to afford to drive his SUV, Larry buys a scooter from Lamar. At the college, he becomes part of a colorful community of outcasts, also-rans, and the overlooked all trying to find a better future for themselves. Two of the classes he takes are speech, taught by Mercedes Tainot (Julia Roberts) and economics, taught by Dr. Ed Matsutani (George Takei). While he initially struggles in speech class, he does very well in economics.
Mercedes drinks at home after school because she is unhappily married to Dean (Bryan Cranston), a former professor turned writer turned blogger. In reality, Dean spends his days looking at internet porn.
Larry's economics classmate Talia (Gugu Mbatha-Raw) invites him to join a club of scooter riders led by her boyfriend Dell Gordo (Wilmer Valderrama). She also updates Larry's home decor, hair style, and wardrobe. Larry's friend Frank (Ian Gomez), who runs the diner, offers him a job to help make ends meet, as Larry had been a Navy cook.
After a night with Dean goes horribly wrong, Mercedes is left alone at a bus stop, where Larry and his scooter gang notice her. Larry offers her a ride home, which Mercedes reluctantly accepts. On their way home they witness Dean getting arrested for drunk driving. At her front door, they kiss. She wants to have sex as well, but Larry declines, not wanting to take advantage of her inebriated state. When Dean arrives home the following morning he finds all of his possessions on the front lawn.
Realizing there is no way he will not lose his house, Larry uses the knowledge he gained in his Economics class to begin a strategic foreclosure. Mercedes, meanwhile, warns Larry not to disclose the events of the previous night, and remains under the false impression that he is romantically involved with the much-younger Talia. It disappoints Larry, who had been excited about Mercedes' interest in him. He goes back to concentrating on his studies and his new job instead.
Mercedes runs into Talia, who is telling Frances, her English teacher (Pam Grier), that she will be dropping out of college to start a thrift store. Mercedes finds out that Talia and Larry are just friends. Later, Frances comes over to Mercedes' apartment to provide emotional support due to her divorcing Dean.
Finals now come, and Larry is scheduled last. His speech is about his travels around the world while in the Navy. Larry is given a big round of applause by his classmates and an A-plus grade from Mercedes, who is now happier in her life, and has rediscovered her passion for teaching.
A short while later, Mercedes and Frances show up at Larry's diner. She lets him know that he was an excellent student, to which he replies that she was an excellent teacher. When the next term begins, some of the students from Mercedes' speech course register for her Shakespeare class, but Larry is not with them. He is seen taking Dr. Matsutani's second-term Economics class. Mercedes walks to her office and sees a note from Larry on the door, which is an invitation for dinner, with the address to his new apartment. She drives there and they kiss.

Question: Why does Mercedes finally leave Dean? 
Answer: Dean gets drunk and leaves her then goes to jail. 
Alternative answer: He was arrested for drunk driving.