Steve Carell's final episode as Michael Scott is Season 7, Episode 22: "Goodbye, Michael". It originally aired on May 6, 2011.
In the episode, Michael departs a day early for Colorado with fiancée Holly. The office throws a subdued farewell. Key moments: Michael's "That's what she said" sign-off, his final "Bourbon. Neat." with Jim, and the emotional airport goodbye where he reveals he's been the "World's Best Boss" all along.
The series continued for two more seasons without him.