Stun was the non-lethal setting on a directed energy weapon, such as a phaser, usually resulting in unconsciousness to a humanoid lifeform.
According to Q, stunning some lifeforms could kill them. (TNG novelization: Encounter at Farpoint) When fired at point blank range, the stun setting could kill both humans and Terrans. (DSC episode: "Magic to Make the Sanest Man Go Mad" & TOS movie: The Undiscovered Country) The stun setting was potentially lethal to an unprotected Trill symbiont. (DS9 episode: "Invasive Procedures")
A single stun blast had little to no effect on an Augment though multiple point-blank shots seemed to have a disorientating effect. (TOS movie: Star Trek Into Darkness)
In 2266, a Klingon duplicate of James T. Kirk stunned Montgomery Scott with a phaser after he refused his order to take the USS Enterprise to maximum warp. (TOS comic: "The Enterprise Mutiny")