If you are staying in the UK for 5 years on a visa, then you may be eligible to apply for Indefinite Leave to Remain (ILR) after completing 5 years in the UK.
To apply for ILR, you will need to meet certain criteria, including having sufficient income. You will also need to pass the Life in the UK Test or the UK Citizenship Test, as well as hold a valid visa.
You can find out more information on how to apply and the requirements for applying on the Gov.uk website here.