A climbing rope is your lifeline, so you should be constantly diligent in maintaining it. When it becomes too old---one to three years depending on how much you use it and the environment in which you are using it---or if it has too many "soft" spots, it should be retired. You can extend the life of your rope by keeping a few key things in mind.
Keep your rope clean
Keep your rope clean by keeping it out of the dirt as much as possible. Rope bags are helpful. And remember to avoid stepping on your rope and grinding dirt into it. When it gets too dirty, you can wash occasionally. Wash it in a washing machine (put it in a mesh bag first) or a bathtub with cold water and non-detergent soak. Allow it to air dry either by hanging it inside or leaving it in a large basket. Avoid drying it in the sun.
Check for frayed spots
Regularly check the outer sheath for frayed parts and/or spots where the core may show through. These easy to see. Dangerous weak points should be cut off (if they are close to the end of the rope) or the rope should be immediately retired.
Check the core for soft, spongy sections
Regularly feel for soft or spongy sections of your rope's core. These often form closer to the ends of the rope after a climber has taken repeated falls. You can tell these spots by how they bend. When you bend a piece of your rope between two fingers, the two sides of the rope should not touch.
Store your rope in a cool, dry place
When not using your rope, store it in a cool, dry place, out of the sun and away from potential moldy areas. Also, be sure to keep it away from chemicals and also areas where mice might live.