Depends on a few factors... but the basics is that the engine must be loaded such that it's operating temperatures come up to normal. For a lot of newer engines, that's about 30% load... but some may want/need more.
On a lot of the older diesel engines I worked on, the issue was that incomplete combustion would cause the exhaust system to 'wet stack' and we'd have un-burned hydrocarbons in the exhaust system. Left unchecked, it can be a fire hazard. Running it at full load gets the temps up high enough to 'cook off' the garbage in the exhaust, as well as any moisture that may have gotten into the engine.
Speaking of moisture, an engine and/or alternator that is subject to ambient conditions will, by the nature of their environment, be subject to water/moisture intrusion. Running your generator and getting the temps up will help burn off this moisture, as will the addition of a block heater and/or alternator heater.
Hope this helps. Any other questions, just ask.
Mark