They last as long as the contract says they do. Theoretically, a non-disclosure obligation could last forever. If the contract does not specify a duration, a court will probably infer a “reasonable time” under the circumstances.