The Highway Code says:
https://www.gov.uk/general-rules-all-drivers-riders-103-to-158/lighting-requirements-113-to-116
"ensure all sidelights and rear registration plate lights are lit between sunset and sunrise
use headlights at night, except on a road which has lit street lighting. These roads are generally restricted to a speed limit of 30 mph (48 km/h) unless otherwise specified
use headlights when visibility is seriously reduced (see Rule 226).
Night (the hours of darkness) is defined as the period between half an hour after sunset and half an hour before sunrise).
226
You MUST use headlights when visibility is seriously reduced, generally when you cannot see for more than 100 metres (328 feet)."
So why do people switch their headlights on when a few drops of rain fall, when the sky is grey, even when the sun is shining, and before sunset? Especially around sunset, most headlights create too much contrast and in my view make it more difficult to see clearly, often side lights are quite sufficient: headlights are normally for the driver to see the road ahead. Some modern headlights are far too bright for oncoming traffic. More lights does not = more safety.
Added to which, many people have the arrogance to to flash their lights at other drivers to switch their headlights on when they deem it appropriate - Please note:
https://www.gov.uk/general-rules-all-drivers-riders-103-to-158/other-stopping-procedures-107-to-112
110
Flashing headlights. Only flash your headlights to let other road users know that you are there. Do not flash your headlights to convey any other message or intimidate other road users.