Checking the toilet flapper chain is the first step when your tanks refills intermittently. A poorly seated flapper will allow the water in the tank to drain out, causing the tank to refill.
Not sure if this is your problem? See the article 'Troubleshooting Toilet Problems' for a listing of all the toilet repair topics.
Checking the Toilet Flapper
Take the lid off the toilet tank. Look at the chain that connects the toilet tank lever to the flapper. Is there a lot of slack in the chain? When there is too much slack the flapper can lift slightly and then the weight of the water can push it back down before it allows the proper amount of water to go into the toilet.
Try it, is the tank draining down completely when you depress the lever? No, adjust the chain so that there is not a lot of slack in it. Not so tight that it holds the flapper open and allows water to drain out.
You adjusted the chain and the toilet flushes correctly. Problem solved, Great.
Replacing a Toilet Flapper
The toilet flushes fine but there is a trickling sound after the tank is completely full. This would mean that the flapper is not seating correctly. You have two choices here, replace the flapper or replace the whole flush valve assembly. A flapper is around five dollar and two minutes work Try this first, it works most of the time, see step two.
See the articles 'Replacing a Toilet Flapper' and 'Fixing Toilet Flush Valves' for options on what can be done at this point.