According to different Puranas, there are different versions of the birth of Lord Ganesha. The most popular is the one in Shiva Purana. Parvatiji created the form of Ganesh from the turmeric paste off her body, and then infused life into the form. Obeying Parvatiji’s instructions, Ganesh did not allow Lord Shiva to enter his own house. In the fierce battle that followed, Lord Shiva finally severed the head of the boy, but had to bring back the boy to life with an elephant head.
The festival begins when people bring in mud idols of Ganesha into their homes, symbolizing the visit of Ganesha in the month of Bhaadrapada, starting on the Shukla (Waxing Moon) chaturthi (Fourth day). The festival ends on Ananta Chaturdashi (Fourteenth day) when the idols are immersed in a river or other water body and submerged to the chants of Ganapati Bappa Moriya Pudhchya Varshi Lavkar Yaa – O Lord Ganapati, Do return soon next year.
Ganesh Chaturthi was being celebrated as a public event in Pune since atleast the times of Shivaji. The public celebration was revived again by Lokmanya Tilak.