In the story, the Jolly Roger is called the "black flag of piracy."
Today, most people associate the Jolly Roger with a skull and crossbones (in white) set against a black background. Such a flag did not gain in popularity until the eighteenth century. In fact, it was first flown by pirates in the Caribbean. The flag signaled the intent to attack and plunder other ships.
Among pirates, however, the Jolly Roger was a symbol of camaraderie. Some pirates even adopted various versions of the flag for fraternal purposes.
In Treasure Island, the flag is flown on the Hispaniola. In chapter 25, "I Strike the Jolly Roger," Jim Hawkins tells Israel Hands that the latter must now consider him the captain of the ship. Hands, badly hurt, does not like the notion. However, he reluctantly bows to Jim's will.
The first thing Jim does as captain of the ship is to "strike the Jolly Roger." He pulls down the pirate flag and throws it overboard. The chapter ends with Israel Hands promising to help Jim set sail for the north.