Yes. A female gnat can lay hundreds of eggs at once. Most often, they do it in moist soil, near the water, and in dark places. It takes about three days to pass the egg stage. Sometimes, gnats can lay eggs indoors. Therefore, do not be surprised if you find gnats or fruit flies in house.