I have a well as my water source, and my water has high levels of iron. This stains and leaves a residue in my sinks, shower, and toilets. It's from from the byproducts of the iron-eating bacteria. It's actually harmless, but it's smelly and ugly.
If you're not sure what's in your water, you should take a water sample to get chemically tested. I found a state certified water lab in the yellow pages under "Chemical Consultants."
Mostly cleaning the toilet just takes elbow grease, patience, and a willingness to work on a gross toilet for some time. I start by just scrubbing with a toilet brush, both in the bowl and in the tank. That gets rid of some of the loose buildup.
Then I put on some long rubber cleaning gloves, get a fresh Scotch-Brite scrubbing pad (a used one is too soft to be effective), and I get started.
I use Barkeeper's Friend, a dry acid-based cleanser. This helps to break down the stains. I shake about 1 tablespoon of Barkeeper's Friend onto the Scotch-Brite pad and scrub it into the stain. I mix Barkeeper's Friend with a small amount of water to make a thick paste and smear that liberally on tough stains. I let it sit for about a minute, and then the stain is a lot easier to scrub out.
The cleaner is helpful in the upper bowl, but it's less effective below the water line as it just dilutes in water. I've tried liquid toilet bowl cleaner too, and that can help.
Just make sure you don't mix acid-based cleaners with chlorine bleach! This produces poisonous chlorine gas. I think liquid toilet bowl cleaners are now made without acids for this reason, but check the ingredients carefully. And wear long cleaning gloves and eye protection.