I know the United States (and Bahamas) kept most of their lighthouses active, although in many cases dimmed the lights so as not to silhouette passing ships (and thus make them U-boat targets). A few lightships were removed from their stations during the war. The U.S. Coast Guard also continued to operate radio beacons at lighthouses and lightships during the war, apparently being thought too important for navigation to turn off for the war. Many US lighthouses also had extra Coast Guard personnel assigned during the war to serve as lookouts.
But what about the rest of the world? Probably every combatant national had lighthouses in 1939 (I don’t know how many had lightships). The UK, France, Japan, and Australia in particular had very long coastlines. Germany and the Soviet Union had lighthouses on the Baltic.
Were these lights left on or turned off? Were they used as lookout towers, as their American counterparts were? Were they ever deliberately attacked or sabotaged (by either side), as many Southern lighthouses had been during the American Civil War? Were lightships sunk? (During World War I, a US lightship was sunk by a U-boat, although I don’t think the Germans attacked any US lightships during WW2.)
I could certainly imagine the Russians deliberately destroying German lighthouses as one more F-U to the Germans, or Germans blowing up French lighthouses to deny them to the Americans after D-Day. Perhaps Japanese lighthouses being turned later in the war due to fuel shortages and to avoid aiding US submarines and bombing raids. But this is all speculative.