According to a story from Bhagavata Purana, Hiranyakashipu and Hiranyaksha are Vishnu's gatekeepers Jaya and Vijaya, born on earth as the result of a curse from the Four Kumaras.
According to Sources the birth place of Hiranyakashipu is Moolsthan (Present Day Multan).
In Satya Yuga, Hiranyakashipu and Hiranyaksha - together called the Hiranyas - were born to Diti (daughter of Daksha Prajapathi) and sage Kashyapa. It is said that asuras were born to them as a result of their union at the time of dusk, which was said to be an inauspicious time for such a deed.
After his brother Hiranyaksha's death at the hands of the Varaha avatar of Vishnu, Hiranyakashipu, started to abhor Vishnu.
To which end he decides to attempt to kill Vishnu by gaining mystical powers, which he believes Brahma, the chief among the devas will award to him if he undergoes many years of great austerity and penance just as Brahma has awarded to other Rakshasas.
This initially seems to work as planned with Brahma becoming pleased by Hiranyakashipu's austerities.
Brahma thus appears before Hiranyakashipu and offers him a boon of his choice. Upon Hiranyakashipu's asking for immortality however, Brahma refuses. Hiranyakashipu then requests the following:
O my lord, O best of the givers of benediction, if you will kindly grant me the benediction I desire, please let me not meet death from any of the living entities created by you.
Grant me that I not die within any residence or outside any residence, during the daytime or at night, nor on the ground or in the sky.
Grant me that my death not be brought by any being other than those created by you, nor by any weapon, nor by any human being or animal. Grant me that I not meet death from any entity, living or nonliving. Grant me, further, that I not be killed by any demigod or demon or by any great snake from the lower planets.
Since no one can kill you in the battlefield, you have no competitor. Therefore, grant me the benediction that I too may have no rival. Give me sole lordship over all the living entities and presiding deities, and give me all the glories obtained by that position.
Furthermore, give me all the mystic powers attained by long austerities and the practice of yoga, for these cannot be lost at any time.
Prahlada and Narasimha
Whilst Hiranyakashipu had been performing the penance to be granted this boon, his home had been attacked by Indra and the other devas, seizing the opportunity in his absence.
At this point the divine sage, Narada intervened in order to protect Hiranyakashipu's wife, Kayadhu, who he describes as 'sinless'.
Following this event Narada takes Kayadhu into his care and while under the guidance of Narada, her unborn child (Hiranyakashipu's son) Prahlada, became affected by the transcendental instructions of the sage even at such a young stage of development.
Thus, Prahlada when later growing as a child began to show symptoms of this earlier training by Narada, gradually becoming recognised as a devoted follower of Vishnu, much to his father's disappointment.
Hiranyakashipu eventually becomes so angry and upset at his son's devotion to Vishnu (who he sees as his mortal enemy) that he decides he must kill him but each time he to attempts to kill the boy, Prahlada is protected by Vishnu's mystical power.
When asked, Prahlada refuses to acknowledge his father as the supreme lord of the universe and claims that Vishnu is all-pervading and omnipresent. To which Hiranyakashipu points to a nearby pillar and asks if 'his Vishnu' is in it:
"O most unfortunate Prahlada, you have always described a supreme being other than me, a supreme being who is above everything, who is the controller of everyone, and who is all-pervading. But where is He? If He is everywhere, then why is He not present before me in this pillar?"
Prahlada then answers, He was, He is and He will be. In an alternate version of the story, Prahlada answers He is in pillars, and he is in the least twig.
Hiranyakashipu, unable to control his anger, smashes the pillar with his mace, and then following a tumultuous sound, Vishnu in the form of Narasimha appears from it and in defence of Prahlada moves to attack his father. In order to kill Hiranyakashipu and not upset the boon given by Brahma, the form of Narasimha was chosen.
Hiranyakashipu could not be killed by human, deva or animal, Narasimha is neither one of these, as he is a form of Vishnu incarnate as a part-human, part-animal.
He comes upon Hiranyakashipu at twilight (when it is neither day nor night) on the threshold of a courtyard (neither indoors nor out), and puts the demon on his lap (neither earth nor space).
Using his nails (neither animate nor inanimate) as weapons, he disembowels and kills the demon.
Even after killing Hiranyakashipu none of the present demigods were able to calm Narasimha's fury, not even Shiva. So all the gods and goddesses called His consort, the goddess Lakshmi, but she was also unable to do so.
Then, at the request of Brahma, Prahlada was presented to Narasimha, and finally, he was calmed by the prayers of his devotee.