The Thousand Names from a Bed of Arrows
The Mahabharata tells of a warrior who could choose the hour of his own death, and who spent his last days teaching. The thousand names of the Lord came out of that teaching.

The warrior who could not die
Bhishma was the son of King Shantanu. After Bhishma took a lifelong vow, his father gave him a boon: control over the time of his own death.
In the great war at Kurukshetra, on the tenth day of fighting, Arjuna, aided by Shikhandi, brought him down with a volley of arrows. He fell, and lay on a bed of arrows. Because his death was his own to choose, he did not die. He waited for an auspicious time, the sun's turn to the north (uttarayana), and while he waited he taught.
The questions
The war was over, and Yudhishthira, who would now rule, came to the dying Bhishma for counsel. Bhishma taught him at length: on the duties of a king, on statecraft, on right conduct.
Then, the Anushasana Parva of the Mahabharata tells, Yudhishthira asked two questions. Who may be said to be the one God in the world? And which, of all the forms of religion, is the foremost?
The answer
Bhishma's answer was that one should always worship the lotus-eyed Lord with devotion and hymn his praises. Then he gave the hymn itself: a thousand names of the Lord.
The names that he recited are the Vishnu Sahasranama. Its closing verses say what comes to the one who hymns them. Such a person, the text says, never meets with fear at any time, and acquires great prowess and energy. One who desires wealth succeeds in earning wealth. A brahmana who does this masters the Vedanta. It is traditionally said to bring name, fame, wealth, knowledge and pleasure.
The man-lion among the names
Among the thousand is a name for the form in which the Lord is worshipped at Yadagirigutta. The twenty-first name is Narasimha-vapuh, "he whose body is that of the man-lion". In the Sri Vaishnava explanation of the name, the Lord took this form by his own free will, to remove the fear from the mind of his devotee Prahlada. That story is told in The Narasimha Avatar: A Boon, a Pillar and a Doorway.
The thousand names at the temple
A Sahasranama Archana takes Bhishma's hymn, or a hymn like it, and turns each name into an offering: one name, one flower. Hymns of a thousand names exist for many deities, and one exists for Lakshmi Narasimha.
Tradition and record
The thousand names are record: they stand in the Anushasana Parva, the thirteenth book of the Mahabharata, and anyone can read them there and in Ganguli's English translation. Bhishma's fall, his boon and his teaching from the bed of arrows are told in the Mahabharata. Which chapter number the hymn carries differs between editions. What could not be confirmed for this article is which thousand names Yadagirigutta chants in its Sahasranama Archana: the Vishnu Sahasranama, a Lakshmi Narasimha Sahasranama, or another.