In the name of Allah the most Gracious the most Merciful,
And those who accuse chaste women and then do not produce four witnesses - lash them with eighty lashes and do not accept from them testimony ever after. And those are the defiantly disobedient - 24:4
First, let us start about the punishment of adultery because it seems that you have a "not totally right idea" about it.
First thing, stoning until death is only for those who commit adultery while they're married. Getting whipped 100 times is for those who commit adultery when they're unmarried.
Now, the most important part about it. This punishment MUST NOT and CANNOT be implemented unless there are four witnesses (refer to surat al noor verse 4 at the top). It is not just "cannot be implemented", the person should not be accused of adultery without four witnesses, and if someone accuses a person for adultery without four witnesses, the one who accused should be whipped eighty times (refer also to surat al nur verse 4 at the top). It is not just to witness an unmarried couple sleeping together. The witness must have seen them during sexual intercourse for the witness to be counted.
From the previous part, we can conclude that for someone to be eligible for the punsihment must have done it in public (how on earth would there be 4 witnesses unless in public). That's why this punishment wasn't implemented at the times of the Prophet much due to it's extreme and strict requirements (it was done between 2 or 3 times as far as i can remember).
Now for the matter of forgiveness. If the person has committed adultery and only Allah knows, and there are no 4 witnesses, then of course, and definitely he/she would be granted forgiveness after Allah's will, as Allah is the most Forgiving and most Merciful.
Last but not least, by Allah's perfect mercy, any punishment (islamic) for any crime (adultery, stealing etc.) in this world will be sufficient enough so that the one who committed the crime would be free from the punishment at the hereafter. That's one of the main reasons for punishments anyways.
I hope that answers your question, and Allah knows best!