LDR connect to opamp switch very fast when low battery
Well there's a resistor missing from your diagram (see below)

then relay switch on and off continue very fast

It's quite likely that you need hysteresis to prevent the relay chattering its contacts when the two op-amp inputs become very close in value.

Make the &quot;resistor needed&quot; about 10 kohm and make the &quot;hysteresis resistor&quot; about 330 kohm.
I would also make sure that the 7805 regulator has input and output capacitors and that you put 100 nF close to the positive and negative supply pins of the LM358 op-amp.