These tiny flies are called fungus gnats. The adult flies don't harm the plant, but their larvae are wormlike, and feed on decaying organic matter, including the roots. It helps to keep the soil on the dry side. You can also get some degree of control by placing yellow sticky cards near the plant to trap the gnats. There is also a chemical called Gnatrol, which works to kill the larvae when applied to the soil.