It is narrated from Hazrat Abu Huraira (may Allah be pleased with him) that the Holy Prophet (peace and blessings be upon him) said: Whoever repents before the event of the sun rising from the west, his repentance will be accepted.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 7711