If a person has been sectioned under the Mental Halth Act, then they will be unable to leave the hospital without medical consent to do so. This is because a person is 'sectioned' if they are considered a danger to themselves or to other people.
If, on the other hand, you have been admitted to a hospital which is not a psychiatric hospital, then you are free to discharge yourself, even if this is against the wishes of the medical staff. This also depends on actually being well enough to get up and leave the hospital, since assistance would not be given to a patient who was discharging themselves, if the medical team disagreed with the patients decision to leave.
Usually the patient would be asked to sign a consent form. This is to establish that the hospital felt that the patient should actually stay in the hospital. In effect this would mean that the patient had to accept full responsibility for the decision to leave and waive any legal rights should the condition deteriorate as a result of leaving hospital.
If, on the other hand, you have been admitted to a hospital which is not a psychiatric hospital, then you are free to discharge yourself, even if this is against the wishes of the medical staff. This also depends on actually being well enough to get up and leave the hospital, since assistance would not be given to a patient who was discharging themselves, if the medical team disagreed with the patients decision to leave.
Usually the patient would be asked to sign a consent form. This is to establish that the hospital felt that the patient should actually stay in the hospital. In effect this would mean that the patient had to accept full responsibility for the decision to leave and waive any legal rights should the condition deteriorate as a result of leaving hospital.