The place to begin for the answer to your question is your contract of employment. Many temporary workers are employed on fixed term contracts which, under the Fixed-term Employees (Prevention of Less Favourable Treatment) Regulations 2002, is automatically converted by law into a contract of indefinite duration (a permanent one) when the employee has worked for the employer for four years.
If the fixed term contract is not renewed it is technically a dismissal and quite apart from having four years’ service, even if you have just one year’s service or more, you will be able to make a claim for unfair dismissal if your employer fails to renew your contracts without following the correct procedure. Whether or not your claim succeeds depends of course on whether your employer acted fairly in the circumstances.
How much an employee would be entitled to claim would depend, among other factors, on how long their employment contract could reasonably be expected to last. Clearly in the case of a fixed term contract under four years duration the employee would not have attained permanent status under the statute and it may be argued by the employer that the job was expected to end on the last date of the fixed term. So the magic number is definitely ‘four’ years.