As you drive, you must turn your headlights on:

Headlights must be used from one half hour after sunset and one half hour before sunrise. They must also be used at any time when visibility is 500 feet or less and any time windshield wipers are being used.
DMV Writen Test