Fungus gnats are not a big deal. Their larva live in wet soil and can hurt seedlings if their numbers grow too large. But mainly they are a sign of overwatering and can be controlled by allowing the top of the soil to dry out between waterings. If you have a lot of them, use the BT in mosquito dunks, also sold by gardens alive as knockout gnats, as a soil drench.
They are the tiny, maggoty larvae that will begin to feed on tender plant roots as their populations rise. That's why we worry about it when our seedling trays become infested.
Many germination mediums and even common potting mixes are very fine textured and peaty...a perfect (though artificial) environment for fungus gnats, even it you don't keep it too moist all of the time. Inside, where there is no place else for the adults to lay eggs, our containerized plants can soon become over-run with the larvae.
At this time of year, you can find mosquito dunks at most garden centers and even hardware stores. Break a few pieces from a dunk and let it soak in your full watering bucket over night. Use that water for your plants. For the next several watering cycles, use the 'dunk' water only.
Mosquito dunks contain a naturally occurring bacterium that affects the larvae of certain insects, such as mosquitoes, black flies (of the northeast), some shore flies, and fungus gnats. The larvae feed on the dunks and the ingested bacterium infects them. This bacterium, named Bacillus thuringiensis-israelensis (Bt-i) is harmless to anything but the targeted larvae.
Next time, search for a much coarser potting mix, one that cannot support fungus gnat larvae. Such a medium can still be used as a germination mix by using a shallow layer of the peaty stuff on top of the coarser material.
Also, as has been said, moisture levels need to be monitored carefully. These insects really love very moist medium.
My potting soil, for example, contains more pine bark than peat moss. I haven't seen a fungus gnat in many, many years.
credits to Gardenweb.com