Yes. For building and other operations and for the use of a property or part of one as a single dwelling, enforcement action must be taken within 4 years. For all other breaches the planning authority must take enforcement action within 10 years. Any enforcement notice issued should specify whether the breach of planning control is one to which the 4- or the 10-year rule applies. For breaches of listed building control, as opposed to planning control, there is no time limit on when action can be taken.
If you are claiming such immunity, the enforcement officer will no doubt be looking for you to provide evidence of this when the contact you, e.g. if the complaint relates to building work, a receipt from the builder showing when the work was carried out.
For some cases, they may ask you to apply for what is called a Lawful Development Certificate. This requires you to provide sufficient evidence to satisfy the planning authority that on the balance of probabilities the use has existed for the necessary period to be immune from enforcement action and, assuming you can do that, the Certificate will be granted.