In Sumerian Mythology, Gilgamesh known as a legendary hero. He is a son of Uruk Emperor (Lugalbanda), who married a wise and beauty Goddess named Nisun. And just like Hercules he became half Human and half God that have a very great power. After his father die, he become the next King, but he couldn't manage his kingdom as a king. So the people of Uruk ask help from a God (Anu). Anu then ask a help from another God (Aruru) and then Aruru create a powerful human, Enkidu.
When Enkidu enter Gilgamesh kingdom, Gilgamesh ask him to fight, but after a long period there's no person who win, they agree to make a peace, then they become a best friend, and rule Uruk kingdom wisely. In Final Fantasy V Gilgamesh appear as boss battle that must defeated several time. Also in Final Fantasy VIII he take place of Odin Position when Odin killed by Seifer in Lunatic Pandora.
Gilgamesh also appear in Final Fantasy IX but only as a non playable character. He appear at the beginning of the game as Alleway Jack, and teach Vivi how to play card game for the first time. He will tell you his real name if you already mastered in Card Game.