The assessment time limits
Four years from the end of the tax year for normal cases (no error or careless behaviour on your part).
Six years for careless behaviour (mistakes that a reasonable person would not have made).
Twenty years for deliberate error or fraud.
These are the maximum periods HMRC has to raise an assessment. Once the period expires, they cannot raise a new assessment for that year.
Enforcement of assessed debts
Once HMRC has raised an assessment, the tax debt is owed. There is no equivalent statute-barred rule for HMRC debts once formally assessed — HMRC can pursue for many years.
This is different from ordinary consumer debts (which are statute-barred after six years without acknowledgement).
If HMRC assesses beyond the time limit
You can challenge assessments raised outside the time limit. This is a formal appeal process through the First-tier Tribunal.
The four-year vs six-year vs twenty-year test depends on your conduct. HMRC has to justify the time limit they are using.
Ongoing PAYE and VAT
For PAYE and VAT, the situation is different — HMRC receives ongoing returns and can raise assessments continuously. Historic errors can still be assessed within the time limits above.