As said in Bhagavatha purana, Lord Vishnu's, Vamana Avathar is meant to restore Indra's power over the heaven.
Bali who was the grandson of Prahalada, was an ardent devotee for Lord Vishnu. Bali dethroned Indra and took the control over the Heaven. Bali emerged as a supreme power in the three worlds, Heaven, Earth and Pathala (beneath the earth), he was hailed by Mahabali. Lord Vishnu who wants to restore the Dharma and protect Earth, which was occupied by Asuras (demons), took the birth as Vamana as he don't want to kill his ardent devotee.
On the day of His Upanaya, Vamana approached Mahabali for a grant. Mahabali was busy with Yajna rituals without paying much attention, granted the wish of having three paces of land that he could traversed through.
Vamana who as Vishnu by himself, took one step to posses the Heaven, second step to posses the Earth and third step and there was no space for the third step. Mahabali bow down and prayed Lord to keep the third step on his head. Vamana pushed Mahabali to Pathala Loka (Beneath the earth) and asked him to rule the Pathala, thus saved Earth and Heaven.
This temple was built by Nandivarma III during 846 - 869 A.D. Later, this temple was renovated by Pallavas and Cholas. The Main deity inside the temple depicts this play. Where Lord shows His one finger of the right hand, which says that He has measured the first step. His left hand shows tow finger, which denotes the second step. For the third step, Lord raised his feet above, denotes the final step on Mahabali's head. Lord here called by Thrivikram.
Other shrines within in the temple complex, Karakatha Perumal, Saravana Perumal and Arun Valli Thayar.