best time is in the next season for exemple, if you are warned that a player is at the end of contract and he's contract will expire, don't worry he won't leave your club right after season is ended, he will appere for 1 more weak in your team with unsigned contract so thats the best time.

by doing that he will have 3 years contract and you will need to pay less moneys too.