The QI presenter will play Malvolio alongside Mark Rylance as Olivia in the Shakespeare's Globe production, as part of their 'The Play's the Thing' season.
The adaptation from Tim Carroll will run from September 22 to October 14.
Fry's appearance will mark his first long-term commitment to theatre since 1995, where he infamously left the production of Cell Mates opposite Rik Mayall after three days, an event he later blamed on his bipolar disorder.
He has appeared in several one-off stage shows, including the Old Vic's production of Cinderella in 2007, and his own one-man spoken word shows.
Stephen Fry will feature in Sky Arts' upcoming series of programmes celebrating the works of Charles Dickens, Oscar Wilde and Noel Coward.
> Stephen Fry is the celebrity that most Brits would want as PM