If you have lived or worked in the UK lawfully for five years, on a Visa that leads to settlement, or ten years, you may now qualify for indefinite leave to remain (ILR).
There are two ways in which you can apply for settlement in the UK, either by using the five-year route which is the case for most sponsored workers or family members of sponsored workers, or other settled citizens, or you could qualify under the long-residency route after ten years.