IMO, I wouldn't suggest changing the plug heat range to adjust for a lean condition, as this is only putting a band-aid on a potential problem. Lean-running engines run hotter and extended running in a lean condition could damage the engine, such as by burning the valves or blowing a hole in a piston. Sometimes the plug can be changed to a hotter one in the case of a rich mixture. More on this in a minute....
This is the perfect segway into plug heat range. The electrode at the tip of the plug will stabilize at a certain temperature while the engine is running. At the correct heat range under correct mixture conditions (as researched by the factory), the plug tip should be "hot" enough to burn off soot and other combustion deposits (a build-up of which can cause fouling and render the plug inoperative), but "cold" enough to keep from overheating the tip (which can cause preigniton of the air/fuel mixture and beating the hell out of the pistons, or in extreme cases the tip gets hot enough to cause physical damage to the porcelain insulator).
How is this controlled? The tip of a hotter plug has a longer stem up inside the metal threaded shell, making for a longer distance the heat has to travel from the tip to the shell and surrounding metal of the cylinder head. Cooler plugs have a shorter stem, allowing the heat to dissipate more rapidly. This difference isn't easily visible unless you cut the plug open.
The heat range of the plug has no influence on the overall running temperature of the engine. This is determined by a range of factors, such as the condition of airflow over the motor, cleanliness of the cooling fins, intake mixture, oil cooling, etc.
Now, getting back to your original question. As I already explained, if the engine is running lean, you could put in a cooler plug to lessen the likelihood of preignition, but if the engine is running really lean, this will only hide a symptom. If the engine is running too rich, a hotter plug could be put in to help it burn off the carbon build-up and keep the plug from fouling. However, in this case if the intake is overly rich, over time carbon will build up on the pistons, valves, etc. Not to mention making for worse gas mileage. Obviously in both extremes in mixture ratio the performance of the bike will suffer.