Unlike firearms, air guns need very little maintenance, but you should never clean your air gun with firearm's cleaning solutions, this will damage the seals on your air gun.
Instead you may clean the barrel of your air gun every 1,000 shots with a light degreaser to remove excess oil and lead build up to keep your air gun accurate, after drying, drop in the barrel a few drops of oil to help prevent rusting.
Blued air guns: To prevent rust on the Blued metal parts of your air gun, a cloth with oil should be passed on the metal each time after you use your air gun. Your finger tips and hands produce moisture and this will cause rusting.
Spring Piston Air Guns: In spring piston air guns it is recommended that you use air gun cylinder oil to lubricate all moving parts every 600 shots, such as all pivot points, trigger, bolt, etc.. The piston and cylinder should be oiled about every 350 and up to 1,000 shots with 3 to 4 drops of a special synthetic air gun cylinder oil (this depends on the manufacture's recommendations). Some air gun manufactures do not recommend oiling the piston, one of these companies is Gamo. Each company is different, the Beeman air gun company recommends oiling the piston every 8-12 month or 5,000 to 6,000 shots with 2 drops of their special cyclinder oil. Do follow the instructions of the company to keep the warrenty valid.
Your spring piston air gun will lose power if you leave it cocked for long periods, this act ruins the spring in your air gun, they should be cocked and fired fast. Never fire a spring piston air gun with out a pellet, this causes damage to the spring piston seal and the piston and might even damage/break the spring, the pressure used to expel the pellet out of the barrel, cushions the impact of the piston. Never fire your spring piston air gun rapidly and repeatedly this causes over heating due to friction in your piston chamber and can burn out your piston seal or melt it and the overheating can ruin your piston's spring. I have seen many spring piston air guns ruined the first day of use, by rapidly and repeatedly firing them, sometimes by people taking turns shooting them. Let them cool off after a few shots.
CO2 air guns: CO2 air guns are a different story, they use powerlets for power and need very little oiling. Just oil the bolt and trigger every 600 shots. Since there is no spring and piston you need only to place 2 drops of cylinder oil on the seal and the needle every 2000 shots where the powerlet/CO2 tank goes to help to keep it moist and from drying. This also helps to create a better seal between the powerlet/CO2 tank and the seal.
Pump Air Guns: Care must be taken with pump air guns, oil tends to stop up the pressure chamber of pump air guns, as a safe rule only oil the piston pump when it starts to squeak with 2 drops of cylinder oil or every 2,000 shots. Do oil pivot points every 200 shots and oil the loading chamber every 600 shots.