That depends on the type of flour. Wheat flour the type that's listed as "flour" on ingredients' labels definitely contains gluten, since gluten is a protein found in the grains wheat, barley and rye. Wheat flour can be listed on a package as "flour," "whole wheat flour" or "wheat flour" all those contain gluten.
Therefore, if you see the word "flour" on an ingredient list with no other explanation (i.e., rice flour or soy flour), you can assume that product contains gluten and can't be eaten as part of a gluten-free diet.
However, even though flour most often is made from wheat, flour doesn't have to be made from wheat by definition, "flour" is simply a powdery substance made by grinding a starch, usually a grain but not always. You can make flour from almonds, chestnuts and even potatoes in addition to different types of grains. Flours made from a starch other than wheat, barley or rye are usually gluten-free (but not always).
When you're reading ingredient labels, you'll see that flour made from anything other than wheat always will be identified as such for example, it will be listed as "rice flour," "soy flour," "chestnut flour," "almond flour" or "(fill in the blank) flour" instead of just as "flour."
As I said, these alternative flours are usually gluten-free, but they're not always safe on the gluten-free diet. Sometimes, they get some gluten cross-contamination during harvesting or processing, which means they contain enough gluten to make them unsafe for someone with celiac disease or gluten sensitivity to consume.
Also, some products that use alternative flours as ingredients also include gluten as another ingredient to eat gluten-free, you always need to check ingredients carefully (see my article How To Identify Gluten on Food Labels for more information).
Of course, many foods made with these alternative flours are aimed directly at the gluten-free market they'll display the words "gluten-free" prominently on the package, which means they should be safe on the gluten-free diet.
The bottom line is, if you see the word "flour" on a food label, you need to read further before you can tell if the food contains gluten or not. But if the ingredients label provides no detail other than something like "flour, sugar, yeast, shortening" then you should assume that particular type of flour contains gluten.