In many parts of India, it is the homecoming of King Rama of Ayodhya after a 14-year exile in the forest. The people of Ayodhya (the capital of his kingdom) welcomed Rama by lighting rows (avali) of lamps (deepa), thus its name, Deepavali. This word, in due course, became Diwali in Hindi. But, in South Indian languages, the word did not undergo any change, and hence the festival is called Deepavali in southern India. Southern India marks it as the day Lord Krishna defeated the demon Narakasura.
Diwali is celebrated on the first day of the lunar Kartika month, which comes in the month of October or November.
In Jainism it marks the nirvana of Lord Mahavira, which occurred on October 15, 527 BC. The Sikhs celebrate Diwali for a different reason; on this day, the Sixth Guru, Guru Hargobind Ji, was freed from imprisonment along with 52 Hindu Kings (political prisoners) whom he had arranged to be released as well. After his release he went to Darbar Sahib (golden temple) in the holy city of Amritsar. There, he was greeted by Sikhs and many other people. In happiness they lit candles and diyas to greet the Guru.