they maybe nematodes. There are approximately 10,000 to 10,000,000 species in the Phylum Nematoda. Free-living (ie without a 'host') forms can reach sizes between 1mm to 2 cm (0.04"- 0.8"). Nematodes that live in the aquarium usually reside in the gravel, but when disturbed they swim in a snake like manner. Much like that of a sea snake. They can be easily seen in a bucket after cleaning the gravel.
There are three types of nematodes: parasitic, scavengers and herbivores. The vast majority of nematodes are parasitic. All three are able to live within the aquarium; however the scavengers are usually the most common.
Not all nematodes are a menace in the aquarium, the scavenger nematodes can help break down the organic waste in the aquarium. If you are treating your fish tank for nematodes, make sure you know that they are parasitic, as the medications you use will kill the beneficial worms as well.
Nematodes can be introduced to the aquarium in egg or adult form. Eggs can be present in almost anything that you add to your aquarium; feeders, live plants, driftwood etc. Adult worms are more likely to be introduced by live plants and in the water accompanying your feeder fish.
Populations of nematodes can be reduced or elimated by reduced feedings and increased water changes and gravel vacuuming.