Of all naval guns the one most likely to appear in fiction set during the Age of Sail is the “long nine.”
There are probably a couple of good reasons for this. First, the hero in these novels tends to be the commander of a sloop or a frigate which admittedly lends itself to much more varied and interesting plots than a 74-gun ship of the line beating a path back and forth outside Toulon, Texel, or Brest. Secondly, the name just sounds cool.
So what was a “long nine.”
In its most elementary form it is a 9-pounder gun. Beyond that the term seems to mean just about anything the author wishes. Patrick O’Brian refers to the long nine as being bronze (Thirteen Gun Salute, The Nutmeg of Consolation, The Truelove) when 9-pounders had been made of cast iron since the late 17th century (in 1660, for instance, according to Brian Lavery only 20 of 9-pounders were bronze) and bronze 9-pounders were shorter by two to four feet than their cast iron brethren.
In 1703, the Ordnance Board decreed that all 9-pounders would come in one of two lengths, eight or nine feet. In the early part of the 18th century the 9-pounder nearly disappeared but had a renascence in the second half of the century. In 1761, it was authorized to be cast in 5 different lengths ranging from 7 feet for use as the main battery by sixth rates, that is, frigates mounting 24 or fewer guns to 9 feet for those used on the upper decks of 80-gun third rates.
In 1782, the nine-foot six-inch 9-pounder was authorized.
If you want a source that gets just about every aspect of the “long nine” wrong by all means use Wikipedia.
From all this we can ascertain that a “long nine” was a cast iron 9-pounder with a barrel length of at least nine feet. And while it was certainly used as a chase piece on frigates and ships of the line but it also served as the main battery on ship-sloops in the 18 and 20 gun category.