These are the famous legends that's being associated with this celebration:
Lord Krishna defeats demon Naragasuran
One widely known legend of Deepavali is none other than the defeat of Demon Naragasuran by Lord Krishna. It is said that Demon Naragasuran ruled Pragjyotishapura, a place which is located near to the present day Assam. Lord Krishna slew the demon and free the people who were living in fear and the day was celebrated as Deepavali.
Lord Rama returns after a 14-year exile
After defeating the Demon King Ravana, Lord Rama returned to his homeland Ayodhya with his wife Seetha and brother Lakshman. The villagers were excited as their favourite Lord Rama returned home after a 14-year exile. They lit lamps to light the path for Lord Rama and the joyous day was celebrated as Deepavali.
These are the stories in Hindhu mythology that depicts the celebration of Deepavali.
Source: Culture Trip
Image credit: Quora, BeingIndian