The Big Bang Theory Season 2 Episode 5
The Euclid Alternative
When Leonard needs to work the graveyard timeslot to gain access to the lasers for his experiment, Sheldon loses his ride to the university. As a result, Sheldon is forced to find alternative transportation and tries to get Penny to drive him on her day off and Wolowitz to take him on his scooter. After he's ejected from both vehicles, Raj is forced to pick him up. The friends eventually stage an intervention and force him get get his driver's license so he can take himself.
When Sheldon goes to the DMV, he manages to get the license without taking the test by annoying the worker. The gang then sets up a simulation for him to test him at the apartment and he does terrible. Sheldon then decides to not use his license and instead move into his office and begin staying there as long as Leonard works the graveyard shift. Leonard ends up not telling Sheldon an the actual end date of his shift is to have the apartment to himself for an extra week.