It's due to one or two things, depending how established the aquarium is (or not).
A new aquarium can take at least a month or two to find its own biological 'balance'. All the bacteria need to get themselves established and priorities sorted out, and the filter system tuned up.
When faced with cloudy water, most newcomers do a big water change but this only sets things back to square one again and then it's another long wait until everything clicks into place.
Another reason for cloudy water is, of course, the actions of the fishes themselves. Goldfish, for instance, are notorious for stirring up the gravel and casing a mist of fine silt to hang in the water. The filter system should clear this.
Overfeeding by the generous owner won't help either.
Partial water changes - 10-15% per two weeks or so - will help keep the water clean of accumulating nitrates.
If your fish have been bought from a local aquatic dealer (whose water supply is probably the same as yours) then you should be able to keep them without altering the water conditions too much. Using tapwater generally presents no problem, although you might have to manipulate the water conditions a little should you intend to breed some of the more 'exotic' species.
When faced with cloudy water, give things a little more time to settle down.
All newly set up tanks look a bit cloudy at first, then suddenly something happens (usually overnight) and the tank is quite clear.