The quest for immortality is the Epic of Gilgamesh's spine: after Enkidu's death the hero crosses the world's edge to ask the flood survivor Utnapishtim the secret of his deathlessness — and fails the test of sleeplessness, loses the plant of youth to the serpent, and comes home to the walls of Uruk: the achievement not of endless life but of the work that outlasts it.
Domain
The epic theme: the pursuit of deathlessness and its refusal
First Attested
The Sumerian Gilgamesh poems and the Old Babylonian fragment's "carpe diem" counsel onward
The counsel: the Old Babylonian tablet's famous advice — when the gods made mankind they kept life for themselves; fill your belly, dance, cherish the child: the quest's answer before it begins.
The tests: sleeplessness (stay awake six days and seven nights — Gilgamesh sleeps instantly) and the plant (the "old-man-becomes-young" weed stolen by the serpent while he bathes): immortality near enough to touch, lost both times.
The return: the walls of Uruk — the lasting work as the human answer to death; the epic's closing the quest's true resolution.
The Etana parallel: the king of Kish's eagle-flight seeks not life for himself but the plant of birth — an heir; the two quests framing the human answers to mortality: eternal life refused, continuity through descendants granted (see Etana).
Evidence & Sources
The epic's Tablets IX–XI and the Old Babylonian "carpe diem" tablet carry the theme; Adapa's refused food and forbidden knowledge its sibling myth.