Gilbert, who is a co-host on daytime chat show The Talk, has joined the sitcom in a co-starring role as introverted yet intense English and drama teacher Irene, according to Deadline.
If the show is picked up to series, Gilbert will continue on The Talk, which also airs on CBS.
Bad Teacher is based on the 2011 movie of the same name, which starred Cameron Diaz and Justin Timberlake.
Ari Graynor (Fringe) will star as Meredith Davis, with In Living Colour's David Alan Grier and Veronica Mars actor Ryan Hansen recently joining the cast.
Gene Stupnitsky and Lee Eisenberg (The Office) are producing the Bad Teacher pilot, and Don Scardino will direct from a script by Hilary Winston (Community).
Watch a red band trailer for Bad Teacher below:
US TV's most exciting pilots - in pictures: