Will Allah Forgive Me If I Repeat the Same Sin?
Question

For how long does Allah forgive a person’s sin? If he repents and seeks forgiveness from his sin, then goes and commits the same sin again, then he seeks forgiveness again then commits the same sin again, and so on – does Allah forgive him or does that mean that he is not sincere towards Allah, especially if he repeats that sin after a short while, but he does not stop seeking forgiveness?
Praise be to Allah.Allah says (interpretation of the meaning): 
“And those who, when they have committed Fahishah (illegal sexual intercourse) or wronged themselves with evil, remember Allah and ask forgiveness for their sins; — and none can forgive sins but Allah — and do not persist in what (wrong) they have done, while they know. For such, the reward is forgiveness from their Lord, and Gardens with rivers flowing underneath (Paradise), wherein they shall abide forever. How excellent is this reward for the doers (who do righteous deeds according to Allah’s orders).” [Al `Imran 3:135-136] 
Ibn Kathir (may Allah have mercy on him) said: 
“The words “and do not persist in what (wrong) they have done” mean: they repent from their sins and quickly turn to Allah, and they do not persist in their sin, rather they give it up, and if they do it again they repent to Him.” Tafsir Ibn Kathir” 
It was narrated that Abu Hurayrah (may Allah be pleased with him) said: I heard the Prophet (peace and blessings of Allah be upon him) say: “A person committed a sin and said: `My Lord, I have sinned; forgive me.’ His Lord said: `Is My slave acknowledging that he has a Lord Who forgives sins and punishes for them? I have forgiven My slave.’ Then as much time passed as Allah willed, then he committed a sin and said, `My Lord, I have sinned; forgive me.’ His Lord said: `Is My slave acknowledging that he has a Lord Who forgives sins and punishes for them?  I have forgiven My slave.’ Then as much time passed as Allah willed, then he committed a sin and said, `My Lord, I have sinned; forgive me.’ His Lord said: `Is My slave acknowledging that he has a Lord Who forgives sins and punishes for them? I have forgiven My slave,’ – three times…” (Narrated by Al-Bukhari and Muslim)
An-Nawawi (may Allah have mercy on him) included this Hadith (narration) under the heading: “Acceptance of repentance from sins even if the sins and repentance happen repeatedly .” 
He said in his Sharh (commentary): 
“We have already discussed this issue at the beginning of the Book of Repentance. These Hadiths clearly point to that, and even if the sin is repeated a hundred times or a thousand times or more , and he repents each time, his repentance will be accepted and his sin will be erased. And if he repents once from them all, his repentance will be valid.” (Sharh Muslim)
Ibn Rajab Al-Hanbali (may Allah have mercy on him) said: 
`Umar ibn `Abd Al-`Aziz said: O people, whoever commits a sin, let him seek the forgiveness of Allah and repent, and if he repeats it, let him seek the forgiveness of Allah and repent, and if he repeats it, let him seek the forgiveness of Allah and repent, for it is like chains around the neck of man, and doom lies in persisting in it.  
What this means is that a person will inevitably commit the sins that it is decreed he will commit, as the Prophet (peace and blessings of Allah be upon him) said: “The son of Adam’s share of Zina (fornication/adultery) is decreed for him, and he will inevitably come to that…” But Allah has given him a way out from the sins that he falls into and He erases them by means of repentance and seeking forgiveness. If he does this then he will escape from the evil of sin, but if he persists in his sin he will be doomed.” (Jami` Al-`Ulum wal-Hikam” 
Although Allah hates sin and warns of punishment for it, He does not want His slaves to despair of His mercy. He likes the sinner to seek His forgiveness and repent to Him, but the devil likes it when despair fills a person’s heart and prevents him from repenting and turning to Allah. 
It was said to Al-Hasan Al-Basri (may Allah have mercy on him): Would not any one of us feel ashamed before his Lord to seek forgiveness from his sin then go back to it, then seek forgiveness then go back to it? He said: “The devil would like you to feel that way; never give up seeking forgiveness.”  
For more details, please see the following answers: 184515 , 142392 , 95758 , and 134211 . 
And Allah knows best.