In Islam we are told that we should ask Allah for forgiveness no matter how many sins we have and He will forgive us if our touba is sincere. There was also and instance when somebody ask for a lady's hand in marriage and another person told the man who was proposing that the girl had committed adultery in the past. Then the Prophet (saw) told the other man that he should not have said that because the girl was ashamed of what she had done and had asked Allah for forgiveness.
However in Islam if a person commit adultery, they have to be stoned to death. Then how can this person ask for forgiveness?
This also applied to other sins where a death penalty applies. Even for someone who steals something, their hand has to be chopped off, so does this mean they will not be punished for stealing in there hereafter because they have already been punished for their mistake? After all Allah is Most Merciful.