If you are in the UK on a visitor visa, then you will not be entitled to free NHS care.
You won't be denied medical treatment in the UK, but you will have to pay for any and all treatment except emergency room treatment (although birth control is free to all). It would be a very good idea to take out travel insurance before coming to the UK as a visitor.
If you are on a work visa valid longer than 6 months, then you will be entitled to free NHS care. You will also be entitled to NHS healthcare if you come to the UK on a student visa valid longer than 6 months, or a family visa (fiance or spousal visa).