Panch Mukhi Hanuman is the form of Hanuman in which he has five faces. This is the Virata Rupa of Hanuman – a gigantic form that is beyond imagination of human mind. There are two forms of Panchmukhi Hanuman – in one all the five heads are that of Hanuman. In another form – only one head is of Hanuman and the other heads are that of Hayagriva, Narasimha, Varaha and Garuda.
As Hayagriva, Narasimha and Varaha are incarnations of Vishnu, Panchmukhi Hanuman is a combined avatar of Vishnu and Hanuman.
The five-faced Hanuman is widely believed to be Tantric representation of Hanuman as he is the perfect Siddha.
A story associated with Panchamukhi Hanuman states that Hanuman took this form to save Sri Ram and Lakshman who were captured by Mahiravan and Ahiravana during the Ram-Ravan war. The demons took them the netherworld and kept confusing the brothers with their black magic. Hanuman fought a fierce battle with the demons but was not able to defeat them. The only way to defeat Mahiravan and Ahiravana was to extinguish five lamps in five different directions simultaneously. To extinguish the five lamps simultaneously Hanuman appeared in his Virata Rupa with five faces.
Please note that the stories associated with Panchamukhi Hanuman are not found in the Ramayana. They are mostly found in Puranas and local folklores.