The man, identified as Shankar Chaudhary, a native of Bihar's Gaya district, was rushed to a hospital. He is out of danger now, DCP (Northwest) Vijay Singh said.
The police are investigating the matter from all possible angles, including that of "human sacrifice".
According to police, the incident took place around 9.30 AM today when Chaudhary went to a temple in Bharat Nagar area. He suddenly fished out a knife from his pocket and slit his throat, amid scores of devotees inside the temple premises.
With the help of locals, police identified Chaudhary and he turned out to be a labourer who stays at a rented accommodation in Sawan Park extension of Bharat Nagar. He is married and has a one-year-old son. His family stays in Bihar and they have been informed about the matter.
From preliminary investigation, it has come to light that Chaudhary was depressed over some family issues. However, it is yet to be ascertained, why he chose a temple to commit the act, an official privy to the investigation said.