In Peter Pan, the Jolly Roger is the name of Captain Hook's ship, but in a naval context the Jolly Roger was the name of a number of flags known to be used by pirates.
The flag most commonly identified as the Jolly Roger is the skull and crossbones, used by the infamous Irish pirate Edward England, born Edward Seegar. England died in 1720 in Madagascar, after he was marooned by his own crew for displaying a conscience.
Peter Pan's nemesis, Captain James Hook, did not play a major part when Barrie first wrote the play. Wikipedia says:
"The pirate captain was created for a front-cloth scene to be staged in front of the curtain while the set was changed from Neverland back to the Darling nursery, depicting the children's journey home."
The role of Hook was only developed further when Barrie witnessed how much children enjoyed the pirates' appearance. Today, it would be inconceivable to imagine the story without him.