From the Super Mario Wiki
The Skull Gem is a red crystal that resembles a skull, and is found in the game Paper Mario: The Thousand-Year Door. Flavio's ancestors stole this gem from Cortez many generations before the events of the game. The Skull Gem is the key component needed to activate the Black Skull, Cortez's ship. Mario required this jewel to access the Pirate's Grotto. Before Mario's adventure to Keelhaul Key, the plumber could find the gem on the table next to Flavio in Podley's Place. Flavio used the jewel to bargain with Cortez, convincing the skeleton pirate to join Mario and Flavio in their battle against the X-Nauts.