Unless you are on a CTO (see below), you are under no legal requirement to continue with treatment after you leave hospital.
Before stopping any treatment, however, we would advise you to raise any concerns you have about your treatment with your care team. It is always better to do things by agreement if possible.