The contract is the central document of business. Oral contracts come into play when you agree to do some work without signing an agreement. Every time you take a job, at least write a memo that lists your business name, the client's name, the task, and a time or cost estimate. For any job amounting to more than a few days' work, get a written agreement before you start. You can work without a written contract for odd-job support work and small development jobs where the cost of having a lawyer review the contract would exceed the profit on the job.
Freelancers can often use a boilerplate contract, filling in the details as needed.
Acceptance criteria are an important part of the contract for developers. The customer may never be satisfied with the final product, and always insist on just one more change. You are in a much better position if the contract states that the customer must accept the product if certain conditions are met. The contract should allow for mutually agreeable changes. These changes take effect only if they're in writing and signed by both parties.