What is the length of a contract?

The answer to this is in the contract itself. It should say that it is for a particular "term", or that it terminates on a particular date or upon a particular event. If the contract doesn't state, then it probably is terminable by either party immediately.