A pistol was a type of projectile weapon. The term was also applied to small hand-held directed energy weapons with a pistol grip.
A pistol was just one artifact found in San Francisco in 2368. According to Data it was a "forty-five caliber single action cavalry pistol invented by Colt Firearms in 1873". (TNG: "Time's Arrow")
The Nazis of Ekos were armed with, among other things, pistols reminiscent of the Luger model known from Earth of the 1930s and 1940s. (TOS: "Patterns of Force")
A revolver was another type of pistol. (TOS: "Shore Leave", "Spectre of the Gun")