Now this one is one of my personal favorites - there are two reasons for this, which I will tell you in a while. The story is related to Sanat Kumaras, the first lot of manas-putras (sons born out of thought and not action) of Lord Brahma. By birth, therefore they arrive on the scene before the 10 Prajapatis -- the celestial beings (including the seven Saptarshis) who were responsible for creating most of the family lines on the Earth -- and that includes devas, asuras and humans too.
The four Sanat Kumaras are: Sanat, Sananda, Sanaka, and Sanatana.
These four Sanat Kumaras are wandering across the worlds, and one day decide to pay a visit to Narayana - the form of Vishnu that rests on Shesh naga. When they arrive at the gates of Vaikuntha, they see that the door is guarded by two keepers Jaya and Vijaya, the famous twins, and that Vishnu is taking a nap. Sanat Kumaras approach Jaya and Vijaya and ask to let them in.
Now as you know, Sanat Kumaras are 'Kumaras' - they look like young boys - mere children. So Jaya-Vijaya refuse to let them in.
Dr. Devdutt Pattnaik has a better explanation here. He says that since Sanat Kumaras came into existence before the Prajapatis - lords of the 5 sense organs and 5 action organs, they are oblivious to the worldly desires. This has had them 'pure' - but their purity is not a sign of wisdom, it is the sign of ignorance. They are chaste by default, and not by design.
They have never engaged with the world. And so, even though they are pure, Vishnu does not meet them.
This is a very powerful statement. There is an old saying in Zen, which goes like this:
"In the beginning (i.e. when one is not learning Zen), mountains are mountains and rivers are rivers; later on (when one starts learning Zen), mountains are no longer mountains and rivers are no longer rivers. But now, (when one attains Zen) mountains are once again (really) mountains and rivers are once again rivers".
In the middle there is complexity, doubt, crumpling of soul. In the beginning and in the end, there is only simplicity. The simplicity of the beginning arises from not going through the experience and hence not knowing, while the simplicity of the end state arises from going though the experience and therefore being completely aware. The problem is - since both states are so similar, it is difficult to tell who is where. It is undoubtably the greatness of Vishnu that differentiates between the two. He allows the Saptarshis (who bore children, populated the Earth and also wrote most of the Vedas) to meet him at different times, but does not meet Sanat Kumaras.
So anyway, coming back to our story of Jaya and Vijaya - Sanat Kumaras try to persuade Jaya and Vijaya, but the twins are true to their duty. The twins also tell the Kumaras that Sri Vishnu is resting and that they cannot see Him now. The Kumaras grow angry at the gate keepers. They tell Jaya and Vijaya that Vishnu is available for his devotees any time. Sanat Kumaras get very angry and leave. Before leaving, though, they curse the two doorkeepers that they will have to give up their divinity, leave Vaikuntha, will be born on the Earth and go through the cycle of Life and Death like normal beings.
When Vishnu wakes up, he learns what has happened and is sorry for his two dwarpals (doorkeepers), who are cursed by the great Sanat Kumaras just for doing their duty. He apologizes to the Sanat Kumaras and promises to his doorkeepers that he will do his best to help them go through the cycle of Life and Death. He cannot lift the curse of the Sanat Kumaras directly, but he puts in front of them - and this is the second wonderful part about this story - two options:
The first option is that they could either be born seven times on Earth as devotees of Vishnu, while the second options is that they could be born three times as His enemy. After serving either of these sentences, they can re-attain their stature at Vaikuntha and be with Him permanently.
Jaya-Vijaya cannot bear the thought of staying away from Vishnu for seven lives, even as his devotees. As a result, they choose to be born three times on Earth even though it would have to be as enemies of Vishnu. Vishnu them takes Avatars and releases them from their lives.
Hiranyakashipu - Born as Daitya in Krita Yuga - released by Narasimha Avatar
Hiranyaksha - Born as Daitya in Krita Yuga - released by Varaha Avatar
Ravana - Born as Rakshasa in Treta Yuga - released by Rama Avatar (Ramayana)
Kumbhakarna - Born as Rakshasa in Treta Yuga - released by Rama Avatar (Ramayana)
Sishupal - Born as Kshatriyas (humans) in Dwapar Yuga - released by Krishna Avatar
Kansa - (Some interpretations say Dantavakra, in which case he was defeated by Sahadeva)
So as they move from one life to another, they move more and more closer to God ... (Asuras being the worst, then rakshasa, then humans and then devas) finally going back to Vaikuntha.
Now, these deaths at the hands of Vishnu released Jaya and Vijaya from their Asura, Rakshasa and Manava forms and ensured their return to Vaikuntha, where they resumed their roles as God's doorkeepers. The images of Jaya and Vijaya look very similar to Vishnu's. They hold in their four hands the conch-shell, the discus, the lotus and the mace. But they possess fangs (have you seen the scary images on the doors of Vishnu temples?), a reminder of their demonic deeds.
What is interesting is that it takes 7 lives as devotees, but only 3 as enemies of God! ... Like Mahabharata says ... "But from the circumstance of his thoughts being constantly engrossed by the supreme being, Sisupala was united with him after death, for the lord bestows a heavenly and exalted station even upon those whom he slays in his displeasure" ...
Such is the fierce power of being bad as compared to good ... Okay, wrong lesson, but I guess you get the point.