The Rambam clarifies a very important point regarding free will and Teshuva. On the one hand, we are taught that man makes choices and he is responsible for those choices.
If he chooses to repent for his sins, there appears to always be place for forgiveness. If this is not the case, then it would look as though there really isn’t complete free will.
The Rambam clarifies this by saying that in most cases, this is true. That is, if one sincerely shows true remorse and regret for his actions, he will be forgiven.
However, there are instances where one’s actions are considered to be so grievous, that Hashem will take away this sinner’s free will. The primary example is Pharoah. After the first five plagues, his heart was hardened, and he was no longer able to repent even if he wanted to do.
Hashem did this in order to punish him for his sins.
There are other instances where Hashem makes it difficult for people to do Teshuva because of their bad behavior. But only a truly evil person like Pharoah has his free will taken from him, where he no longer is able to repent, even if he wants to.