If you sign a player to a 1 year contract, you may trade him at any time after June 15th that year.

If you sign a player to a multi year contract, you may trade him only after:
2 years: June 15th the 1st year
3-4 years: June 15th the 2nd year
5 years+: June 15th the 3rd year

This is to stop any GMs from pursuing (presently or in the future) free agents without the intention of using the player themselves; signing a player only because of his trade value.