Shesha is generally depicted with a massive form that floats coiled in space, or on the universal ocean, to form the bed on which Vishnu lies. Sometimes he is shown as five-headed or seven-headed, but more commonly as a many hundred-headed serpent, sometimes with each head wearing an ornate crown.
He is closely associated with Vishnu. His name means “that which remains”, from the Sanskrit root śiṣ, because when the world is destroyed at the end of the kalpa, Shesha remains as he is.
Sesha was born to sage Kashyapa and his wife Kadru.
Kadru gave birth to a thousand snakes, of which Sesha was the eldest. After Sesha were born Vasuki, Airavata and Takshaka, in order.
A lot of Sesha’s brothers were cruel in nature and were bent upon inflicting harm on others. They were even unkind to Garuda, who was Kashyapa’s son through Vinatha, sister of Kadru. (Kadru and Vinatha were daughters of Daksha)
Sesha, disgusted by the cruel acts of his brothers, left his mother and kin, and took to austere penances. He lived on air, and meditated in various places including Gandhamadhana, Badrikāshrama, Gokarna, Pushkara and Himalayas. His penances were so severe that his flesh, skin and muscles dried up and merged with his frame.
Brahma, satisfied with his penances, asked Sesha to request a boon. Sesha asked that he be able to keep his mind under control so that he could continue to perform ascetic penances. Brahma gladly accepted the request.
Brahma then asked a favour of Sesha – to go beneath the unstable earth and stabilize it. Sesha agreed and went to the netherworld, and stabilized her with his hood. He is known to support her even today, thus making Patala his perennial residence. (Mbh, Adi Parva)
Sesha with Vishnu and Mahalakshmi
It is shown that he comes back to Patala when the purpose of his Avatar is complete (as in he case of Lakshmana and Balarama).
Sesha is also depicted as floating in the ocean, forming the bed of Vishnu. He is also known as Adisesha (the foremost of snakes) and Ananthasesha or just Anantha (endless, as he is known to remain in existence even after the end of the Kalpa, when the whole world is destroyed)