How much time do you have to take legal action on a breach of contract?

It varies between jurisdictions. Most jurisdictions imposed a statute of limitations on civil claims, and normally 6 years is about the average for breach of contract.

However, certain jurisdictions will allow longer limitation periods for formally executed contracts known as "deeds" (not title deeds, contracts executed under seal) and for these the limitation period can be as long as 12 years.

Limitation periods are however a slightly complex area of the law. The time limit normally only starts to run from the time that the potential claimant becomes aware of the breach, or ought to have become aware of the breach if they were being reasonably diligent. Similarly, there are also a number of people who are often "exempted" from the effect of limitation periods. This usually includes minors (limitation does not run until they reach majority), sometimes includes the mentally disabled, and in some countries the Government is exempt.