In traditional prescriptive grammar
'less' is the comparative used when speaking of a continuous quantity
that is not numerically quantifiable (that is, with mass nouns
). 'Fewer', on the other hand, is used of discrete quantity
and numerically quantifiable quantity (or count nouns
Thus, "There is less flour in this canister," but "There are fewer cups (grains, pounds, bags, etc.) of flour in this canister," since flour is uncountable unless it is measured in a unit, in this case cups.
A similar distinction exists between 'much' and 'many'.
Less/fewer under 'Mass noun'