Although shrines of Hanuman are in abundance across the Indian subcontinent, especially in hilly terrains like Maharashtra, shrines of "Panchmukhi" Hanuman are a rarity. Of course, there is more likelihood to find one in the Southern parts of the country. The images of the Great Vanara (not Monkey) God in Northern India usually depict him as pulling his chest apart to show Lord Rama and Sita, or flying through the air carrying an entire mountain in one hand. But none of these have Hanuman depicted as having more than one heads.
The form of Hanuman as "Sri Panchamukha Anjaneya Swami" (Anjaneya = "son of Anjani") is more famous in the South and some other parts of the world. Some of the famous places where this form is seen are: Kumbakonam and Thiruvallur, both in Tamil Nadu.
Unlike Dattatreya who was born with three heads, or Ravana with ten heads, Hanuman was indeed born with one head. So where does this concept of a 5-headed Hanuman come from?
It happened during the war between Rama and Ravana's armies in Lanka. As it so happens, two powerful rakshasa brothers Mahiravana and Ahiravana are fighting on the side of Ravana. In some scriptures they are said to be Ravana's sons and are summoned by their father to help him after many of Ravana's warriors and generals are killed.
Mahiravana is the ruler of the Patalpuri (Patala i.e. Hell). Now Mahiravana, being a powerful practitioner of dark arts and magic (known to be a great devotee of Goddess Kali) locates Rama and Laxmana by his magic. Mahiravana disguises himself as King Dasharartha, and gets past Hanuman's fortress who is guarding them. He captures Rama and Laxmana while they are sleeping, drags them down and holds them captive in his palace in Patala.
Mahiravana leaves a trail behind, which goes deep into the bowels of the earth. Searching for them, Hanuman reaches Patala whose gates are guarded by a creature called Makardhwaja. Hanuman subdues him and ties him up before entering Patalpuri to rescue Rama and Lakshmana.
Upon entering Patala, Hanuman discovers the two brothers held captive meant as sacrifice to Goddess Kali, and also that in order to kill Mahiravana, Hanuman must simutaneously extinguish five lamps burning in five different directions. Thus, Lord Hanuman assumes the Panchamukha or five-faced form of:
1. Sri Varaha facing the North
2. Sri Narasimha facing the South
3. Sri Garuda facing the West
4. Sri Hayagriva (a much earlier Avatar of Vishnu) facing the sky and
5. His own (Hanuman) facing the East
Thus equipped with the five faces, Hanuman blows out the lamps, kills Mahiravana (in some versions, he sacrifices the demon himself to Goddess Kali, thus earning her favor by virtue of which she made Hanuman her doorkeeper - Indeed many temples of the goddess are seen to have a monkey guarding their doorways) and thus rescues Rama and Laxmana.
to this day, Hanuman is invoked in any fight against sorcery, and amulets and charms depicting him are therefore extremely popular among devotees.
Some popular folklore has a different version in which Mahiravana is killed, but that does not explain Hanuman's five faces. So I prefer this one that I have narrated here.
I really liked the photo attached to the wikipedia article about Panchmukhi Hanuman, so I am shamelessly pasting it here.
The five faced Hanuman icon is reckoned to be the most powerful form of this god. It was once the most popular and again came to light since it was the main deity of Sri Raghavendra Swami, a 16th century Hindu saint who advocated Vaishnavism and the Dvaita philosophy advocated by Madhvacharya (as against the Advaita philosophy by Sri Sankaracharya).