These 7th century shrines (or temples; either term is appropriate) were carved during the reign of King Mamalla (Narasimhavarman I, c. 630 - 670), after whom the site (Mamallapuram, also called Mahabalipuram) is named. Each temple is a monolith, carved whole from an outcropping of rock. (The number of separate formations is a matter of debate; the four north-south temples may have been carved from a single mass.) The temples are unfinished, and so were never consecrated or used for worship. The buildings are called rathas (pancha rathas means "five chariots"), and named individually after Draupadi and the Pandava brothers, although they have nothing to do with temple carts or the Mahabharata. It would be better to call them vimanas and just number them 1 through 5, but the popular names have stuck.
The view in this photo is from the northwest. In the foreground is a carved lion. Behind the lion, from left to right in the photo, are the Draupadi, Arjuna, and Bhima Rathas (Dharmaraja Ratha is hidden in this photo behind the other structures). To the right is the Nakula Sahadeva Ratha.
The site gives the delightful impression of a city of life-size model buildings, whose variety of roofs, floor plans, and columniation defines a veritable source-book of South Indian temple forms. The architectural elements seen here will appear repeatedly, and with remarkably little variation, over the next 1,000 years of temple building in South India.
The ultimate origin of these forms traces back to wood construction, but opinions differ about whether their direct antecedents were secular or sacred, wooden or stone, buildings. It is likely, due to the advanced design of the Mamallapuram shrines, that temple building had previously undergone a substantial process of development, and that the shrines mark a rapid transition from the earlier wooden temples to later structural monuments in stone.