The Pirates just appear in the episode: Grandpappy the Pirate. These Pirates were once Mr. Krabs' Pirate crew. Mr. Krabs gave them jewels from the treasure that Mr. Krabs and his crew got. Mr. Krabs said that when all the jewels were gone that he sold his ship and fired his pirate crew.
Mr. Krabs: So I bought me a ship, hired a crew.....
Crew member: Aaarrrrr!
Mr. Krabs: And for years, I drifted the high seas as a pirate. And booty did abound.
Crew members: (lined up to get paid)
Mr. Krabs: I started to notice a recurring fee. I just wasn't turning enough profit. So I fired me crew and sold me ship. ‘Twas also the last time I saw me granddad.