It is a litter box located in a private room in SpongeBob's house that serves as a bathroom for Gary and contains a sliding pet door. The box is orange in color and depicts Gary's name written in yellow on one side. It is filled with litter for Gary to urinate or defecate on.
Gary's litter box first appears in "Dumped" when SpongeBob convinces Gary to abandon Patrick and return to him. During the process, the former dumps the litter in the box onto himself and tells Gary that he doesn't need to use his litter box for bathroom purposes anymore and can go anywhere he likes.
It reappears in "Gary in Love" when SpongeBob tries looking for Gary and presumes he is in his litter box, due to the Seaweed Noodle Stew he was fed the preceding night. SpongeBob plugs his nose with a noseclip and pops his head through the sliding door to find Gary, but doesn't find him there.