Sayyiduna Ibn Umar (may Allah be pleased with them both) said: I heard the Messenger of Allah (peace and blessings be upon him) say: "No believing servant repents to Allah a month before his death except that Allah accepts it from him, and even less than that; and even a day or an hour before his death, if Allah knows sincere repentance and devotion from him, He accepts it from him."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 13552