إِنَّمَا ٱلتَّوْبَةُ عَلَى ٱللَّهِ لِلَّذِينَ يَعْمَلُونَ ٱلسُّوٓءَ بِجَهَـٰلَةٍ ثُمَّ يَتُوبُونَ مِن قَرِيبٍ فَأُو۟لَـٰٓئِكَ يَتُوبُ ٱللَّهُ عَلَيْهِمْ ۗ وَكَانَ ٱللَّهُ عَلِيمًا حَكِيمًا Qur’an An-Nisaa' (4:17)Innam a a l ttawbatu AAal a All a hi lilla th eena yaAAmaloona a l ssooa bijah a latin thumma yatooboona min qareebin faol a ika yatoobu All a hu AAalayhim wak a na All a hu AAaleeman h akeem a n
The expression min qarib, which here implies nearness in time, could also be rendered as "soon", i.e., soon after having committed the evil deed; most of the classical commentators however, hold that in this context it denotes the time before the actual approach of death. This interpretation is borne out by the next verse.
A person’s repentance will be accepted as long as they repent any time before their death. But one should not procrastinate because they do not know when they will die.