You can apply for settlement (ILR – Indefinite Leave to Remain) if you have been in the UK continuously for 20 years. The 20-year period does not need to be lawful, but it needs to be continuous. Any time spent in prison will not break the continuity, but it will not be counted towards the period of residence.
However, remember, that you will have to wait for a while after the 20 years to be able to achieve settled status.
If successful, you will be granted limited leave to remain valid for 30 months. Subsequently, you can apply for ILR once you accumulate 120 months of lawful residence with leave to remain under 20 years long residence application.
You can of course also apply for a renewal of your leave to remain.
Your continuity of residence will break if:
- You are absent from the UK for more than 6 months at a time, or for a shorter period without a valid leave to enter the UK on your return or leave to remain upon departure
- You have been removed or deported from the UK
- You’ve left the UK showing a clear intention not to return
- been convicted of an offence and been given a custodial sentence, or ordered to be detained in an institution other than a prison, such as a hospital or young offenders institute, not including suspended sentences
- spent a total of 18 months outside the UK throughout the whole 20-year period