The Table Spread - 5:34 Except those who repent before Allah seizes them. Know that Allah is Forgiving, Merciful.
Repentance is invalid at the time of death:
Prophet Jonah/10:90 "We took the Children of Israel across the sea, and Pharaoh and his army fell behind them arrogantly and hostile. When he was about to be drowned, he said, "I believe that there is no god but the one believed in by the Children of Israel, and I am a Muslim."
Prophet Jonah/10:91 Too late! You had rebelled before and were among the transgressors.

The Women/4:18 "The repentance of those who do evil continually and when death overtakes them say, "I have repented"is invalid. And the repentance of those who die as disbelievers is void. For them is a painful torment."

The Family Of Imran/3:90 The repentance of those who disbelieved after their belief and went further in their disbelief will not be accepted; they have gone astray.