What to KnowGenerally, fewer is used when a number of things can be counted ("fewer problems") and less is used when an amount is measured ("less trouble" or "less time"). However, this is not a strict rule and there are accepted instances of less being used with countable amounts such as "250 words or less," "3 items or less," and especially with money ("less than $20") and distance ("less than 3 miles"). Note that in all these cases, the things considered are often thought of as amounts rather than numbers.
There's a commonly repeated rule about fewer and less. It goes like this: fewer is used to refer to number among things that are counted, as in "fewer choices" and "fewer problems"; less is used to refer to quantity or amount among things that are measured, as in "less time" and "less effort."
This rule is simple enough and looks easy enough to follow, but it's not accurate for all usage. The fact is that less is also sometimes used to refer to number among things that are counted.
Origins of The Fewer vs Less Rule
This isn't an example of how modern English is going to the dogs. Less has been used this way for well over a thousand years—nearly as long as there's been a written English language. But for more than 200 years almost every usage writer and English teacher has declared such use to be wrong. The received rule seems to have originated with the critic Robert Baker, who expressed it not as a law but as a matter of personal preference. Somewhere along the way—it's not clear how—his preference was generalized and elevated to an absolute, inviolable rule.
Exceptions to the Rule
Despite the rule, less used of things that are countable is standard in many contexts, and in fact is more likely than fewer in a few common constructions, especially ones involving distances (as in "less than three miles"), sums of money (as in "less than twenty dollars"), units of time and weight (as in "less than five years" and "less than ten ounces"), and statistical enumerations (as in "less than 50,000 people")—all things which are often thought of as amounts rather than numbers.
The use of less to modify ordinary plural count nouns (as in "made less mistakes") is pretty rare in writing and is usually better avoided, though it does occur frequently in speech.
But less is actually preferred in phrases like "an essay of 250 words or less." It's also—to the chagrin of some—the preferred choice in the supermarket checkout line's "twelve items or less" sign. (Some grocery stores have apparently been convinced by the chagrin, though, and use "items or fewer." They are still very much in the minority.)
Less is common following a number, as in "a package containing three less than the others," and is the typical choice after one, as in "one less worry."
A definitive rule covering all possibilities is maybe impossible. If you're a native speaker your best bet is to be guided by your ear, choosing the word that sounds more natural in a particular context. If you're not a native speaker, the simple rule is a good place to start, but be sure to consider the exceptions to it as well.