This automated light system is slowing down randomly
If this is the complete schematics of your setup then there is something missing that might be the cause of the observed behavior: 

The decoupling caps. Or more precisely, the lack of decoupling capacitors.

Try to put a ~100nF capacitor between GND and Vcc of the ATmega. As close as possible to it's power pin. Voltage spikes, probably from the relay may disturb, reset, or do strange things to your ATmega. And this could be a cause of the observed behavior.

Other hints:


Check that you have a free wheeling diode connected at your relay input.
Use a voltage regulator IC to power your ATmega instead of a direct battery connection.


These things would ensure a clean power supply to your ATmega. And this is a good thing. Especially when you use its ADC.