The best time to clean your generator is when it's not working. These units are abused, neglected, and yet expected to deliver flawless performance. Generators are not designed to stay without maintenance.
The first step of maintenance is to check the oil. At least change it after 20 hours of use. Ensure you store the unit away from moisture, corrosive vapors, excessive dirt, and dust. Ensure you don't hose the equipment down with water.
If you're storing the unit for more than a month, empty the fuel. Alternatively, you can add a fuel stabilizer and run it through the system.
Finally, clean your generator periodically using a damp cloth. You may also use a soft bristle brush to prevent scratches on your equipment.