Honestly I think it depends on the circumstance. But companies (at least US ones) always try to make these contracts much more restrictive than they could ever actually get away with. I once worked for a company that said I was not allowed to work for a company in a related market segment for 2 years after leaving the company.