A contract is a legally enforceable agreement. Contract law is the body of decisions, laws, and rules for when contracts come into existence, and they provide remedies when the agreement is breached. Contract law is based primarily on state law and the court decisions interpreting those laws.
At the most basic level, a contract requires an offer, an acceptance of that offer, and adequate consideration. Consideration is what one party pays to induce the other party to make the contract. It does not have to be money; it can, for example, involve giving up something that the party has a legal right to do (I'll give you $50 if you stop smoking.)
An offer and an acceptance without consideration is a gift, which is not an enforceable promise. Once an offer, an acceptance, and adequate consideration are present, the parties are required to fulfill their promises. Other factors that may affect a contract's validity are age (contracts with minors can be voided), legality (contracts with an illegal purpose cannot be enforced), and a written document (some contracts are required to be in writing).
In some cases, and under certain conditions, a court will enforce a promise that hasn't yet met all the requirements of a contract. The most common example involves what is known as detrimental reliance. Detrimental reliance exists where one party reasonably relies on statements made by the other party to take steps and incur expenses. For example, if one party agrees to have a second party build an addition to his home, but then changes his mind, if the second party buys materials in expectation of building the addition, detrimental reliance may exist. In those cases, the court will typically either require the breaching party to go through with the agreement or to repay the other for the expenses incurred.
This IS NOT intended to be legal advice or in any way replace the advice and judgment of a licensed lawyer. Every case and situation is unique and only a licensed lawyer can offer legal advice which is appropriate for your situation