Jaya and Vijaya are the two gatekeepers, dwarapalakas of the abode of Vishnu, known as Vaikuntha Loga. According to the Bhagavata Purana, the Four Kumaras, Sanaka, Sanandana, Sanatana, and Sanatkumara who are the manasaputras of Brahma (sons born from the mind or thought power of Brahma), visit Vaikuntha, the abode of Vishnu, to see him. Due to the strength of their tapas, the four Kumaras appear to be mere children, though they are of great age. Jaya and Vijaya, the gate keepers of the Vaikuntha interrupt the Kumaras at the gate, thinking them to be children. They also tell the Kumaras that Sri Vishnu is resting and that they cannot see him now. The enraged Kumaras replied Jaya and Vijaya that Vishnu is available for his devotees any time, and cursed both the Dwara Palakas, the gate keepers Jaya and Vijaya, that they would have to give up their divinity, be born as mortals on Earth and live like normal human beings.
When Jaya and Vijaya were cursed by the sanatkumaras at the gateway of Vaikuntaloka, Mahavishnu appeared before them, and the gatekeepers requested Vishnu to lift the curse of the Kumaras. Vishnu says curse of Kumaras cannot be reverted. Instead, he gives Jaya and Vijaya two options. The first option is to take seven births on Earth as a devotee of Vishnu, while the second is to take three births as his enemy. After serving either of these sentences, they can re-attain their stature at Vaikuntha and be with him permanently. Jaya and Vijaya cannot bear the thought of staying away from Vishnu for seven lives, they agree to the second option to become enemies.
In the first birth as enemy to mahavishnu, Jaya and Vijaya were born as Hiraëyakña and Hiraëyakasipu in Satya Yuga. Hiranyaksha was an Asura the son of Diti and Kashyapa. He was slain by the god Vishnu after he (Hiranyaksha) took the Earth to the bottom of what has been described as the "Cosmic Ocean". Vishnu assumed the Avatar of a boar - Varaha and dove into the ocean to lift the Earth, in the process slaying Hiranyaksha who was obstructing Him. The battle lasted one thousand years. He had an elder brother named Hiranyakashipu, who after having undertaken penances which made him incredibly powerful and invincible unless several conditions were met, was later slain by Narasimha, another avatar of Vishnu.
In the next Treta yuga Jaya and Vijaya were born as Rävana and Kumbhakarna, and were killed by Lord Viñnu in His forms as Rämachandra and Lakshmana.
At the end of the Dwapara Yuga, Jaya and Vijaya were born their third birth as Sisupäla and Dantavakra (an ally of Jarasandha, a friend of Shishupala and an enemy of Vasudeva Krishna) and Mahavishnu appeared as Krishna/Vasudeva and Balaräma and again killed them. Therefore, two attendants of the Lord in Vaikuṇṭha named Jaya and Vijaya became Hiraṇyakaśipu and Hiraṇyākṣa in Satya-yuga, Rāvaṇa and Kumbhakarṇa in the next Tretā-yuga, and Śiśupāla and Dantavakra at the end of Dvāpara-yuga. Because of their fruitive acts, Jaya and Vijaya agreed to become the Lord's enemies, and when killed in that mentality, they attained salvation in oneness.
In this way Jaya and Vijaya attained liberation after three briths.