Headlights must be used:

Drivers must use their headlights between sunset and sunrise. You should use lower headlight beams, not your bright lights, when approaching within 500 feet of or following within 300 feet of another vehicle.
DMV Writen Test