One common thing is adjusting idle on a cold engine. When hot, the engine dies. So, idle speed is increased to compensate. Always bring the engine up to temperature before adjusting idle.
Another possibility is a maladjusted starting clutch cable (if the bike uses this method) The starting clutch drags and slows the engine, so idle speed needs to be increased.
Another cause is a dirty carb.. Or a float level in need of adjustment.. Or a leaky float valve.
The result is a poor idle air:fuel mixture and the bike won't really idle.. So "idle" speed needs to be very high. Some carbs have both an idle speed and an idle air:fuel mixture adjustment.. some don't.
Vacuum leaks in the intake manifold area from old dried out gaskets can make a good idle impossible.. so can minor carb fuel leaks.. So can dirty air filter elements.. So can the accumulation of carbon in the exhaust system.
When the lights are on they draw current and the magneto presents an increased load to the engine. The engine must now idle under this added load. RPM drops. So set idle speed while this electrical load is present.
If any lamps are replacements and are drawing more current than the stock lamps, even more load is present. Replacing lamps with the proper wattage values may help a lot.
The general health of the entire ignition system.. wires, connectors, components, etc. can also have something to do with this.
there's probably 10 more possibilities. But in short, the bike has to be returned as close to it's As-New tuned condition as is possible.