Best Day Ever/The Gift of Gum - S4-E20
Continuity mistake: When SpongeBob tries to steal the gum at night, he's dressed as a bandit, but then the next day when Sandy finds him, he's wearing his normal clothing. He was stuck in the gum all night so there's no way he would have changed.