Consult the Extinguisher's Rating
Fire extinguishers can last anywhere from 3 to 12 years, with exact age lengths varying from manufacturer to manufacturer. Look at the bottom of the extinguisher for the manufacturer's expiration date. You shouldn't have to replace the extinguisher until this date is approaching, or until the pressure meter on the extinguisher's head falls below the green area.
Check the Extinguisher Regularly
You should inspect your extinguisher every month, visually examining it for signs of corrosion, leakage, clogged nozzles or damage of any sort. Make sure the extinguisher is easily accessible at all times, and is never obstructed. Replace the extinguisher when it shows signs of age or wear, not when it reaches an arbitrary shelf life.
Fire extinguishers don't last forever. While you shouldn't keep one longer than its recommended lifespan, you should definitely replace it if it's in anything but perfect condition. And as always, if the pressure meter is in the red, it's time to get a new extinguisher.