Toilets are supposed to gurgle when you flush; the reassuring sound tells you that the toilet and waste pipes are all functioning properly. A toilet isn't supposed to gurgle when you aren't using it, though. If it does, it usually means that negative air pressure -- suction -- is developing in the pipes, and that isn't supposed to happen. You can usually trace the cause to partially or fully blocked vent pipe.
The Drain Waste Vent System
The plumbing code is very specific about the purpose of the vents in a residential plumbing system, and that purpose is to maintain the water seals in all the fixture P-trap, including those in the toilets. When the vents are blocked, flowing water creates negative pressure that -- if it's strong enough -- can pull water out of the traps. If the pressure isn't strong enough to empty a toilet trap, water may slosh back and forth in the bowl and gurgle as air gets sucked through it. The water may even bubble as the pressure in the pipes becomes positive in front of a column of flowing water.
A Venting Problem
If the gurgling is an unusual sound you hear when you flush the toilet, it's probably caused by a blockage in the waste pipe, and you can usually clear that with a toilet plunger or toilet auger. Toilet gurgling that occurs in an idle toilet when another drain in the house is being used, however, is almost always related to poor venting. The gurgling is usually most noticeable when someone uses a drain through which a large volume of water flows quickly, such as another toilet or a bathtub or washing machine, but you could conceivably hear the toilet gurgle when you're using the sink in the same bathroom.
Why You Should Fix It
You may be tempted to just ignore your gurgling toilet, but you shouldn't because it's a sign of a problem that's only going to get worse. If you aren't already noticing it, you'll probably soon notice slow draining from certain drains or toilets. If you allow this to continue, you'll soon have to clear troublesome blockages in the pipes. Another thing you may have noticed is sewer smells from one or more drains. They occur because the suction is strong enough to empty the fixture trap. Besides being unpleasant, that's an unsafe and unhygienic condition. Sewer gases are laden with dangerous bacteria, and they're flammable.
What to Do
The vent system terminates with the vent stack on the roof, and that is the first place to look for blockages. If it's winter and the gurgling just started, the vents may be blocked by ice or snow, or a small animal may have sought refuge in the relative warmth inside the pipe. Summer blockages can be due to leaves, twigs and dirt. Clear the blockage, and if it recurs, consider widening the vent opening to a maximum of 4 inches, insulating the part of the pipe that passes through the attic or covering the opening with a grate to keep animals and birds out. If you see no blockage in the vent opening, call a plumber, who can clear your vents with a sewer auger.