If you are a learner driver you must take and pass your theory test before you book your practical test.
However, if you already have a full driving licence, you may not have to take another theory test if you want to start driving a different vehicle
You will need to take a theory test if you want a licence for a new category of vehicle. For example, if you have a car licence and you want a motorcycle licence you will need to take a category specific theory test.
If, however, you want to upgrade within a vehicle category you will not normally need to take a theory test. For example, if you have a full automatic car licence and you want a manual car licence you will not have to take a theory test.
It is your responsibility to make sure you have the right licence for the vehicle you are driving. If you are unsure if you need to take a theory test, contact the DVLA.