I recall a sad situation in my ministry years ago.
I was asked for advice on the matter of forgiveness—where the pastor of a church had been living a double life for some years.
The pastor thought that all he needed to do was to say he was sorry, and then the church ought to allow him to continue as the pastor as though nothing had happened.
The man who came to me for advice wanted to know if the minister's past history should be immediately forgotten because he had said he was sorry. My friend was concerned to hear from Scripture how to deal with someone who had a secret life of sin that finally came to light.
I pointed out to my friend that in the case of John the Baptist (Matthew 3:7-8), he made a distinction between people who were regularly sinning—like the Pharisees and Sadducees—and those who were not as actively evil.
In the case of the "vipers" John referred to, they didn't show the humility appropriate to repentance. He wanted them to go away and "Produce fruit in keeping with repentance" before being worthy to be baptized.
So—in cases of habitual sinning—the forgiveness and reconciliation are deferred until the offending person demonstrates in his life what he confesses with his mouth. Only then should the person be reinstated into full fellowship with the party that was offended.
This was Paul's teaching regarding the sinful man in the church at Corinth.
Paul did not give a timetable for bringing the offending man back into the church at Corinth, so we are left to our own judgment on how long is enough.
Withholding forgiveness is scriptural—but should be done with a view toward reconciliation if possible.
We are to work in hope that the offending person will truly change their ways and start acting in a godly manner.