Contrary to popular belief, spirits don't necessarily get better with age. Like wines, they can peak at a certain time, then slowly decline in quality thereafter.
Unfortunately, there isn't a hard and fast rule that applies to every type of liquor. Dave Pickerell, a former master distiller for Maker's Mark, offered some general advice to Slate:
Pickerell puts the ideal ageing range for rye (whiskey made with rye as its primary component, as opposed to corn or other grains) between nine and 11 years, while the "sweet spot" for bourbon (made with corn as its primary ingredient) is anywhere from six to 10 years. And scotch? "While it depends on the type and style," he says, "20 years is a good number."
This principle applies primarily to barrel-aged spirits. The variety of alcohol and the type of wood play huge roles in the ageing process. For example, Bourbon is always aged in brand new barrels, which allows the drink to absorb the flavours of the wood quickly, and thus peak early. Scotch on the other hand is aged in used barrels, so it takes a lot longer to absorb the right amount of flavour from the wood.
40 per cent ABV in a glass bottle is unlikely to change much over the years, so you don't need to worry too much about this at home. If you're out at a bar or a nice liquor store however, you may want to think twice before coughing up extra for a glass of 40 year old whiskey. For more details on the science behind ageing spirits, be sure to check out the source link.