The story
Chiefly by the metaphor of extinguishing someone's lights as sources of illumination (thus putting out their lights, e.g., snuffing out their lamps, lanterns, candles, or torches), but the sense of light as sightedness or vision is cognitively adjacent, nearly setting up an interpretation of lights as referring to the eyes themselves, which close (via the eyelids) at the advent of unconsciousness; the potentially variable figurativeness behind by one's lights is comparable here.
Etymology from Wiktionary, CC BY-SA 4.0.