Assalamualaikum ustaz. A person repents for a sin he committed, however, his nafs tempt him and he was defeated and repeats his sin. Is his repentance accepted? Hope for an explanation.
Waalaikumussalam wrt. wbt.,
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions, and all those who follow his footsteps until the Final day.
According to Kamus Dewan, repentance is regret for a sin (evil deeds and others) and the determination to never commit the sin (evil deed), guilty conscience (regret) for the sin and determination to never repeat it. It also means returning to God (by leaving any other actions that are prohibited and obeying all the commandments). 
Ibn Manzur said repentance is returning to Allah from sin or return to obedience after sinning or returning from sin.  Repent also mean returning to Allah with true repentance. It also means to leave sins. The word istitabah means asking a person to repent. 
While in terms of its terminology, repentance is a regret that leads to a determination and resolve (to leave a sin), as well as a regret that results in the knowledge that sins are a barrier between a person with his lover. 
Repenting from sins is obligatory. Allah SWT commanded us to repent through His statement:
وَتُوبُوا إِلَى اللَّـهِ جَمِيعًا أَيُّهَ الْمُؤْمِنُونَ لَعَلَّكُمْ تُفْلِحُونَ
“And turn to Allah in repentance, all of you, O believers, that you might succeed.” 
Ibn Kathir said: Perform whatever has been commanded upon you from beautiful and commendable character. Leave the norm of the jahiliyyah who possess despicable character, for success can only be attained by obeying the commandments of Allah SWT and His Messenger and leave anything that has been prohibited by Allah and His Messenger. 
Allah SWT also states:
وَأَنِ اسْتَغْفِرُوا رَبَّكُمْ ثُمَّ تُوبُوا إِلَيْهِ يُمَتِّعْكُم مَّتَاعًا حَسَنًا إِلَىٰ أَجَلٍ مُّسَمًّى وَيُؤْتِ كُلَّ ذِي فَضْلٍ فَضْلَهُ
“And [saying], “Seek forgiveness of your Lord and repent to Him, [and] He will let you enjoy a good provision for a specified term and give every doer of favor his favor.” 
Ibn Kathir said: It means, and I commanded you to ask for forgiveness to Allah SWT for the past sins and repent to Him from the act and you should be steadfast and committed in the matter. 
Imam al-Nawawi stated in the book Riyadh al-Salihin: “The scholars said, repenting from every sin is obligatory. If the transgression (sin) is between a slave and Allah SWT – that isn’t related to the rights of people – then there are three conditions for it:
- Distancing and avoiding the sin
- Regretting ever committing the sin
- Determined and set a resolve to never repeat the sin forever
If one of the conditions isn’t fulfilled, then his repentance is invalid.
However, if the transgression involves the rights of others, then there are four conditions. They are the first three conditions with the addition of:
- He should ask to be freed from the right of the person he has wronged. If it is in the form of property or something similar, then he should return it (to the person he has taken it from unjustly). If it is in the form of a false accusation or others like it, then he should clear his name or seek his forgiveness. If it is in the form of ghibah, then it must be asked to be made halal. 
Thus, in the effort of attaining forgiveness from Allah SWT, one’s repentance must fulfil at least the four above-mentioned conditions.
Regarding the Issues of Recurring Repentance
In a hadith narrated from Abu Hurairah RA, he heard Rasullullah PBUH say:
إِنَّ عَبْدًا أَصَابَ ذَنْبًا ، وَرُبَّمَا قَالَ : أَذْنَبَ ذَنْبًا ، فَقَالَ : رَبِّ أَذْنَبْتُ ، وَرُبَّمَا قَالَ : أَصَبْتُ ، فَاغْفِرْ لِي ، فَقَالَ رَبُّهُ : أَعَلِمَ عَبْدِي أَنَّ لَهُ رَبًّا يَغْفِرُ الذَّنْبَ وَيَأْخُذُ بِهِ ، غَفَرْتُ لِعَبْدِي ، ثُمَّ مَكَثَ مَا شَاءَ اللَّهُ ، ثُمَّ أَصَابَ ذَنْبًا أَوْ أَذْنَبَ ذَنْبًا ، فَقَالَ : رَبِّ ، أَذْنَبْتُ أَوْ أَصَبْتُ آخَرَ ، فَاغْفِرْهُ ، فَقَالَ : أَعَلِمَ عَبْدِي أَنَّ لَهُ رَبًّا يَغْفِرُ الذَّنْبَ وَيَأْخُذُ بِهِ ، غَفَرْتُ لِعَبْدِي ، ثُمَّ مَكَثَ مَا شَاءَ اللَّهُ ، ثُمَّ أَذْنَبَ ذَنْبًا ، وَرُبَّمَا قَالَ : أَصَابَ ذَنْبًا ، قَالَ : قَالَ رَبِّ ، أَصَبْتُ أَوْ قَالَ أَذْنَبْتُ آخَرَ : فَاغْفِرْهُ لِي ، فَقَالَ : أَعَلِمَ عَبْدِي أَنَّ لَهُ رَبًّا يَغْفِرُ الذَّنْبَ وَيَأْخُذُ بِهِ ، غَفَرْتُ لِعَبْدِي ثَلَاثًا ، فَلْيَعْمَلْ مَا شَاءَ
“If somebody commits a sin and then says, ‘O my Lord! I have sinned, please forgive me!’ and his Lord says, ‘My slave has known that he has a Lord who forgives sins and punishes for it, I, therefore, have forgiven my slave (his sins).’ Then he remains without committing any sin for a while and then again commits another sin and says, ‘O my Lord, I have committed another sin, please forgive me,’ and Allah says, ‘My slave has known that he has a Lord who forgives sins and punishes for it, I therefore have forgiven my slave (his sin). Then he remains without Committing any other sin for a while and then commits another sin (for the third time) and says, ‘O my Lord, I have committed another sin, please forgive me,’ and Allah says, ‘My slave has known that he has a Lord Who forgives sins and punishes for it I, therefore, have forgiven My slave (his sin), he can do whatever he likes.” 
Imam al-Nawawi said: “This hadith is clear in terms of its dalalah, that even if the sin is repeated a thousand times or more, and he repented for each of it, then his repentance is accepted and his sin is forgiven. Even if he repented once, after all the (sins) he committed, then his repentance is accepted.” 
However, the repentance should be sincere and with full regret. Not by just reciting istighfar but in his heart he still wanted to continue with the sin.
This is as stated by al-Imam al-Qurtubi as cited by al-Hafiz Ibn Hajar in Fath al-Bari, he said: “The hadith (above) shows how great the benefit of istighfar is and the vastness of the blessings of Allah. However, the mentioned istighfar here is the istighfar where one’s heart has the same intention as the tongue that is uttering it which is to leave sin and it is followed with sincere regret. This is the meaning of repentance.”
“It means whoever repeated his sin and repentance, for every time he fell into sin he then repented. It doesn’t mean a person who utters request of forgiveness from Allah whilst his heart intended to continue with the sin.” 
Hence, when a person repented, it must be done whole-heartedly. When a person fell into sin, ask for forgiveness from Allah for the mistake. Never lose hope from istighfar.
Someone said to al-Hasan al-Basri: “Shouldn’t one be ashamed towards our lord? He asks for forgiveness for his sins, but then he commits it again, then sinned and asked for forgiveness again.”
Then, Imam al-Hasan al-Basri replied: “The shaytan hopes that he’ll succeed in making you feel that way. Hence, never stop from istighfar (asking for forgiveness and repenting).” 
Allah SWT also states:
وَالَّذِينَ إِذَا فَعَلُوا فَاحِشَةً أَوْ ظَلَمُوا أَنفُسَهُمْ ذَكَرُوا اللَّـهَ فَاسْتَغْفَرُوا لِذُنُوبِهِمْ وَمَن يَغْفِرُ الذُّنُوبَ إِلَّا اللَّـهُ وَلَمْ يُصِرُّوا عَلَىٰ مَا فَعَلُوا وَهُمْ يَعْلَمُونَ
“And those who, when they commit an immorality or wrong themselves [by transgression], remember Allah and seek forgiveness for their sins – and who can forgive sins except Allah? – and [who] do not persist in what they have done while they know.” 
Ibn Kathir said, regarding the above statement by Him, (وَهُمْ يَعْلَمُونَ) “while they know”, Mujahid and ‘Abdullah bin ‘Ubaid bin ‘Umair said: “They know that whoever repented to Allah, surely, Allah will accept his repentance.” Likewise, it is stated in His verse:
أَلَمْ يَعْلَمُوا أَنَّ اللَّـهَ هُوَ يَقْبَلُ التَّوْبَةَ عَنْ عِبَادِهِ
“Do they not know that it is Allah who accepts repentance from His servants?” 
And in another of His statement:
وَمَن يَعْمَلْ سُوءًا أَوْ يَظْلِمْ نَفْسَهُ ثُمَّ يَسْتَغْفِرِ اللَّـهَ يَجِدِ اللَّـهَ غَفُورًا رَّحِيمًا
“And whoever does a wrong or wrongs himself but then seeks forgiveness of Allah will find Allah Forgiving and Merciful.” 
Recurring repentance and istighfar is accepted as long as the sin isn’t repeated after repentance and that it fulfils the previously stated conditions of repentance.
Allah SWT states:
يَا أَيُّهَا الَّذِينَ آمَنُوا تُوبُوا إِلَى اللَّـهِ تَوْبَةً نَّصُوحًا عَسَىٰ رَبُّكُمْ أَن يُكَفِّرَ عَنكُمْ سَيِّئَاتِكُمْ وَيُدْخِلَكُمْ جَنَّاتٍ تَجْرِي مِن تَحْتِهَا الْأَنْهَارُ
“O you who have believed, repent to Allah with sincere repentance. Perhaps your Lord will remove from you your misdeeds and admit you into gardens beneath which rivers flow.” 
Ibn Kathir said: True repentance is a full determined resolve that can remove all bad things that were previously present, that will unify and gather people who repented, as well as prevent himself from despicable acts.
Hence, scholars stated: True repentance is a determination to leave the sin in the future and regret the past sins and followed by a determination to never return to it in the future. Subsequently, if the sin is related to the rights of a person, then he should return it (the right) that he has taken. 
Lastly, may Allah SWT forgive all our sins and grant us understanding in obeying His commandments.
 See 4th Edition of Kamus Dewan [http://prpm.dbp.gov.my/Cari1?keyword=taubat]
 See Lisan al-Arab, 2/61
 See Basa’ir Zawi al-Tamyiz, 2/304
 See al-Mughni, 14/192
 (Surah al-Nur: 31)
 See Tafsir al-Quran al-‘Azim, 10/225
 (Surah Hud: 3)
 See Tafsir al-Quran al-‘Azim, 7/411
 See Riyadh al-Salihin, hlm. 41-42
 Narrated by al-Bukhari (7507)
 See Syarh al-Nawawi ‘ala Sahih Muslim, 9/128
 See Fath al-Bari, 21/89
 See Jami’ al-‘Ulum wa al-Hikam, 19/26
 Surah Ali Imran: 135
 Surah al-Taubah: 104
 Surah al-Nisa’: 110
 Surah al-Tahrim: 8
 See Tafsir al-Quran al-‘Azim, 14/60-61