Gary was not originally a main character. Stephen Hillenburg created Gary as a background joke; he thought it would be funny if SpongeBob's "pets" were a singing clam named Shelley and a meowing snail named Gary. He included these ideas in his series bible, not as major characters, but as "things in SpongeBob's house." As the first season went into production, the writing team found much more use for Gary than they did for Shelley. Nickelodeon's marketing team also found that Gary "emerged as an unsung hero" in terms of popularity with kids.
For season 2, Gary was promoted to the show's main character sheet. He was the first new main character to be promoted, but he would not be the last; Plankton and Karen were added later. Since his promotion, Gary has appeared in numerous episodes. The vast majority of his roles are background cameos, but he has had a number of significant roles, such as "Have You Seen This Snail?" The third theatrical movie is set to feature him as a major plot element.