They are fungus gnats and their life cycle involves some back and forth between the soil and the plant. If you take some landscape cloth (permeable black plastic) and cover your soil, (just like a barber covers you with a cloth around your neck) you will break the cycle. An inch of perlite as the top layer in the pot will do the same thing. Diatomaceous earth works, too, but after watering it can clump up and become expensive mud. They are generally a sign that you're watering too much.