Best Day Ever/The Gift of Gum - S4-E20
Character mistake: SpongeBob tries to steal the gum off his door at night. The next day, SpongeBob says that it was still Best Friends Day, so he would give Patrick his gum back. Really, it should have been the next day.
Answer: I believe this is the Season 6 episode "Spongicus".