"The NHS operates a residence-based healthcare system and not every person is entitled to free NHS treatment in England. Provision of free NHS treatment is on the basis of being ordinarily resident. Ordinarily resident means, broadly speaking, living in the UK on a lawful and properly settled basis for the time being.
If you are not ordinarily resident in the UK, you are considered to be an overseas visitor and may be charged for NHS hospital services. It is strongly recommended that you take out sufficient health insurance to cover your stay.
If you are coming to the UK on a temporary stay of more than six months, you may be required to pay an immigration health surcharge at the time of your visa application.
If you have paid the surcharge or you were exempt from paying it, and your visa allows you to be here for more than six months, you will be entitled to free NHS hospital treatment in England on the same basis as an ordinarily resident person. This will apply from the date your visa is granted until it expires.
However, if your visa is curtailed or ended earlier than planned by the Home Office, you will become chargeable for any further NHS hospital treatment from that date on, even if you have paid the surcharge. You will also be charged for any non-exempt treatment you received before the start date of your visa."