For your guitar to be in its best condition (i.e. sound and playability) the strings must be correctly fitted, in good shape, and appropriate to the guitar and player.
Many of the common problems with tuning, intonation, rattles and buzzes, loss of volume, and more, and be attributed to playing strings that are old or worn.
You should replace your guitars strings in proportion to the amount of use they get. As perspiration (sweat) and dirt rapidly shortens string life, players must remember to clean their strings with a dry lint-free cloth immediately after use. This will not only ensure the life of the strings is prolonged, but will also help to maintain the frets and fretboard for longer.
A good specialist string cleaning cloth is the The Swipe, and can be purchased cheaply from all decent guitar shops.
"The Swipe - a special treated cloth for cleaning strings after use, removing dirt and finger grease. Regular use will prolong the life of bronze, phosphor bronze, steel and nickel strings."
See the guitar string installation tips lesson for more help.