Gilgamesh's most famous and important quest involves his search for the secret of immortality and his encounter with the immortal Utnapishtim. This quest ends in total failure.
Gilgamesh, within The Epic of Gilgamesh, is presented as two-thirds divine and one-third human, a background that is reflected in his achievements. Gilgamesh out-wrestles Enkidu (finding his closest friend in the process), defeats and slays the giant Humbaba, and defeats the Bull of Ishtar. Up to this point, his entire life has been a series of victories and triumphs, and Gilgamesh certainly has the confidence and self esteem to match his achievements.
The death of Enkidu represents what looks like his first taste of real suffering. It is an experience that leaves him reeling, leading him onto his quest for immortality. Utnapishtim, after alerting Gilgamesh to the impossibility of his goal, sets for him a test. He challenges Gilgamesh to stay awake for a span of six days and seven nights, but Gilgamesh swiftly falls asleep. Later, as Gilgamesh departs, he is told about a plant with the ability to restore youth. Gilgamesh retrieves the plant but later loses it to a serpent.
Ultimately, then, for all that Gilgamesh is partially divine, he is also partially human, and if the first part of Gilgamesh is focused on his superhuman abilities and achievements, this last part is primarily focused on his humanity. In this sense, one might say that what Gilgamesh gains is the knowledge of what it means to be human, and an awareness as to his own limitations: that, for all his strength and achievements, he is just as mortal as any other human being, with all the limitations that this status entails. Immortality is the domain solely of the gods.