A sight was a means by which the operator of a ranged hand weapon can more easily and accurately acquire a target for the weapon.
In 2270, while examining setting 6 on the Slaver weapon, Spock remarked that a self-destruct mechanism would not have a gun sight. Later, Chuft-Captain noted that setting 8 also had no gun sight. (TAS: "The Slaver Weapon")
A sight can be as simple as physical protrubances on top of the weapon which are aligned to acquire the target. An example would be those on the Thompson submachine guns used by the Iotians in the 2260s. Other sights can be far more complex, such as the exographic targeting sensor Chu'lak mounted on a TR-116 rifle in 2375. (TOS: "A Piece of the Action"; DS9: "Field of Fire")
Several types of Federation phasers also utilized sights, including the Type 1 phaser and Type 2 phaser of the 2260s, the model of phaser rifle used in the 2260s, and those used in the 2370s. The exact capabilities of each are not known, but the 24th century phaser rifles are said to have "multiple target acquisition" capability, and "gyrostabilization" built in. (DS9: "Return to Grace")
The sight on the Type 1/Type 2 is not immediately apparent in most episodes, but a detailed physical examination of one of the surviving "hero" phasers has documented its presence. (TOS Season 3 Disc 7 "A Star Trek Collector's Dream Come True"; Star Trek: Communicator)
The sight on the 2260s phaser rifle is likewise not easily recognized, but is on the rear of the "tower" above the rifle hand grip. The one on the first rifle used in TNG-onwards is a flip up type most easily seen in DS9: "The Siege of AR-558" (Kellin had a nervous habit of playing with it.)
Extensive use of computerized sights and compensators would also explain how characters could hit targets with their weapons not even properly aligned with them, as happened in many episodes of the newer shows.