What is the purpose of regular water changes, and how frequently
should they be done?

The solution to pollution is dilution; water changes replace a
portion of "dirty" water with an equal portion of clean water,
effectively diluting the concentrations of undesirable substances in
your tank. In an established tank, nitrate is the primary toxin that
builds up. Regular water changes are the cheapest, safest and most
effective way of keeping nitrate levels at reasonable levels. During
the tank cycling phase, however, ammonia or nitrite may be the
substances that need to be diluted and removed. Likewise, if
medications have been added to your tank, they may need to be removed
after they've served their primary purpose.

The effectiveness of water changes is determined by two factors:
their frequency and the percentage of water that is replaced. The
more often water is replaced, or the greater the qantity of replaced
water at a change determines overall effectiveness.

The benefits of water changes must be balanced by the stress caused
by a sudden change of your tank's water chemistry. If tank water has
similar pH, GH and KH as tap water, changing 50% (or more) of the
water at one time will not affect fish. On the other hand, if your
tank's pH is (for example) 6.3, while your replacement water has a pH
of 7.5, replacing 50% of the water all at once will change the pH of
your tank significantly (possibly more than 50% depending on buffering
factors), which will stress your fish, possibly enough to kill them.

Because water changes are the first line of defense in dealing with
problems such as disease, you want to be able to do large, frequent
partial water changes during emergency periods. Consequently, you
want your tank's water chemistry to closely match that of your
replacement water. That way, you always have the option of performing
large water changes on short notice. Note that this is the way tanks
start out; when you initially set up your tank, the water is the same
as that from your tap. Over time, however, the tank's water chemistry
may "drift" relative to tap water due to acidification from the
nitrification cycle, the addition of chemical additives such as
"Ph-up" or "Ph-down", the use non-inert tank gravel (e.g. crushed
coral or sea shells), etc.

How frequently should partial water changes be made?

The more frequent the changes, the less water that needs to be
replaced. However, the longer between changes, the more stressful
changes potentially become, because a larger portion of the water gets
replaced. Replacing roughly 25% of your tank's water bi-weekly is a
good minimal starting point, but may not be enough. The proper
frequency really depends on such factors as the fish load in your
tank. Nonetheless, you should do water changes often enough so that:

Nitrate levels stay at or below 50ppm, and preferably
MUCH lower (less than 10ppm is a good optimal value).

The change in water chemistry resulting from a change is
small. In particular, the before and after pH of your tank shouldn't
differ by more than .2 units. (Use a test kit the first few times to
get a feel for what's right.) If your pH changes too much as a result
of a water change, perform changes more frequently, but replace less
water at each change.

Water changes remove nitrates after they've been produced.
Nitrogenous substances in the form of uneaten fish food, detritus,
etc. can also be removed BEFORE they get broken down into
nitrate. This is achieved by cleaning your mechanical and biological
filter regularly, and by vacuuming the gravel with a gravel
cleaner. This should be done every time you perform a water change,
e.g., every two weeks.

Note: if your heater becomes partially exposed to air as the water
level drops while doing changes, be sure to unplug your heater while
doing your water changes. The heater can crack if the water level
drops below the heating coil!

Also, be sure to dechlorinate/dechlorimate the replacement water
before adding it to your tank! (see section XXX)