John makes an excellent point.
But there are bulb socket adaptors and similar gadgets with light sensors to turn on outdoor lights, and some of the little solar powered LED garden lights have photo cells to turn them off and on. Many of these are 10 $'s or so at home centers.
However a photo cell from Digikey is probably less than the shipping cost with no experimentation needed to re-purpose it.