The common guideline is to use “less than” when modifying uncountable nouns (e.g., “less than a gallon left”) and “fewer than” when modifying countable nouns (e.g., “fewer than three people”).
However, there are many exceptions to this rule. For example, when describing time (“less than thirty minutes”) or money (e.g., “less than thirty bucks”), “less” is the standard word to use, although time and money can be divided into countable units.