It is common for less to be used when fewer would be appropriate.* The correct usage basically boils down to whether you’re referring to something that can or cannot be counted.
Use fewer with countables and less with uncountables.
If you mean smaller in number, use fewer. This applies when you are referring to people or things in the plural. You can count them, e.g. books, students.
If you mean smaller in quantity, use less. This applies when you are referring to something that doesn’t (normally) have a plural. You cannot count it, e.g. music, mud.
You should also use less when referring to a number on its own and expressions of measurement and time. Less is also correct when referring to age and sums of money. This is because you are referring to the total amount rather than individual units. (This is usually expressed as less than. For example, less than sixty miles, less than £80, less than four years.)
* The use of less in front of nouns that can be counted (count nouns) is not a new phenomenon. King Alfred the Great did it in c.888. The rule against using less in front of plural count nouns is usually traced back to one grammarian writing in 1770 (and it was not intended to be as strict as it has become in modern usage). It will be interesting to see if using less with count nouns becomes acceptable once more.