A restraining order is a court order form that is issued toward an indivdual, preventing them from getting close to a person. It only appears in the episode "Restraining SpongeBob."
Role in episode
Squidward, after getting tired of SpongeBob bothering him at the Krusty Krab, issues him a restraining order. SpongeBob isn't allowed to get within 15 feet of Squidward until the restraining order is lifted. Squidward is pleased by this but SpongeBob has difficulty handing out orders to Squidward due to the restraining order.
However, Mr. Krabs then hires Patrick to take out the orders. Unfortunately for him, Squidward finds Patrick even more bothersome than SpongeBob, so at the end of the episode, he changes the restraining order to have Patrick not allowed to come within 15 feet of him.