The energy coming from solar panel is stored in battery during day time and this energy has to be used to turn on the LED's at night. How to switch automatically the battery to charge during day and to discharge at night..?
You don't switch the battery. You switch the LED on and off as appropriate. It always draws its power from the battery. The solar panel independently dumps it's power into the battery when it can and when the battery isn't full.
The circuit that decides whether it's appropriate to switch on the LED probably draws a few µA when the LED is off, but that is inconsequential in the scheme of things.
I think you can do that with a P-Channel mosfet, when the solar panel provide voltage (daylight) to the VGs (Gate) no current passes through the drain and the source. In the dark Vgs is equal to 0v and current pass trough the drain and source.
Note :I am not an electronic engineer, maybe another people can help you.