The purpose of the on/off switch on your solar lights is to prevent the light's battery from running out too quickly. Your lights aren't always needed and turning them off in these instances helps reserve energy and ensures batteries last longer.
Not all models come with an on/off switch but those that do offer more flexibility and control.