Captain Colter Stevens (Jake Gyllenhaal) was killed in action two months prior to events of the film. His brain is being kept alive by Dr. Rutledge (Jeffrey Wright) in order to participate in the experimental Source Code program, which allows the subject to relive the final eight minutes of someone's life. Stevens consciousness is transported into a passenger on a train en route to Chicago and he is tasked to find out who bombed the train before the bomber commits a second, more deadly, attack on Chicago. After much trial and error, Stevens successful identifies the bomber as Derek Frost (Michael Arden), the man who is always seen dropping his wallet before leaving the train.
After Frost is apprehended, Stevens requests to go into the Source Code one last time, so he can have a chance to save the people on the train, especially Christina (Michelle Monaghan), who he began to fall for over the course of his mission. Despite being reminded that the passengers are only shadows of events that have already happened, Goodwin (Vera Farmiga) sends him back in with the warning that he will be disconnected from life support (which was promised by Dr. Rutledge) at the conclusion of the eight minutes.
Using all the knowledge he gained from the previous visits, Stevens successfully manages to disarm the bomb and apprehend Frost. He also manages to get Christina to fall for him and he makes a goodbye call to his father. He is also seen sending an e-mail to Goodwin. Meanwhile, Dr. Rutledge, who is planning to expand the Source Code program, decides to go back on his word and keep Stevens in the program (by erasing his memory). After finding this out, Goodwin locks herself in with Steven's respirator. Knowing that his time is nearly up, Stevens kisses Christina right as Goodwin disconnects him from life support.
After being disconnected, Stevens finds that his consciousness still exists upon the train. The trains stops in Chicago and Stevens and Christina end up happily together. Meanwhile, Goodwin receives Stevens e-mail, which states that Source Code was more successful than anyone imagined, since it successfully managed to create an alternate reality. Stevens tells her that there is likely a Colter Stevens in her reality waiting to be entered into the Source Code program (which has now been delayed because the bombing was stopped) and that she should help him as well.
Thanks Sean K!