It is a black handlebar mustache that is capable of flying.
Role in series
It is created by SpongeBob using the magic pencil. SpongeBob adds it to Patrick's face because Patrick requests it. Soon after, it comes to life and flies away. It ends up on Squidward's head, who thinks it's hair.
It later flies off Squidward's head when he falls while trying to pick up a fake dollar bill.
"The Slumber Party"
Somehow, SpongeBob possesses the mustache. He uses it for his pizza delivery sponge disguise to get into Pearl's slumber party, but it eventually flies away.