Although most climbing hardware is made of high quality steel and aluminum alloy, the materials will wear with time. Corrosive materials like household cleaners, car maintenance products, salt water, and the stress of everyday use will shorten their lifespan.
It's no fun to clip a rope and see the gate stay open, or fiddle with the trigger wires to remove a stuck piece. So keep moving parts on carabiners and cams as clean as possible. Wash and leave them to dry in a cool, well-ventilated place.
Use a dry silicone spray to lubricate springs and other moving parts. Household oils and WD40 are not ideal lubricants because they attract and hold dirt particles.
A good rule of thumb with all climbing gear is to retire it if you have any doubt about its safety. If a biner is deformed, has visible signs of damage or wear, the gate is bent, or the spring action is too soft or too stiff – retire it. (Note that the anodized coatings on some biners will wear off with use and does not mean they need to be retired.) You don't need to throw them out, just mark them clearly so they will never be used for climbing. You can still use older biners for clipping your coffee mug and tying up your dog.
You should also retire gear that has been dropped a long distance, or even a short distance onto a hard surface. Tiny, and invisible stress cracks can greatly reduce strength. For this reason, never use gear found at the base of climbs, “bootied” off routes, or obtained anywhere that you can't verify its history.
Never trust station-lowering carabiners or chains without careful inspection. Repeated lowers often wear these items down. Better to rap, rather than lower, to reduce wear.