In the UK, medicines need to have a licence before they can be marketed. To get a licence, the manufacturer of the medicine has to provide evidence that shows that the medicine works well enough and is safe enough to be used for a specific condition and for a specific group of patients, and that they can manufacture the medicine to the required quality. Medicines can be prescribed without a licence (an 'unlicensed medicine') if there is no suitable licensed alternative and it is likely to benefit the patient.
A medicine can also be prescribed 'off-label'. This means the prescriber wants to use it in a different way than is set out in the terms of its licence. This could mean using the medicine for a different condition or a different group of patients, or it could mean a change in the dose or that the medicine is taken in a different way. There is more information about licensing medicines on NHS Choices.