The Photosphere is the layer of the star from which light propagates, i.e., Plasma/gas from which photons directly leave the star. Beneath the photosphere, photons are generally captured by atoms before leaving the star.
This is an inexact definition in that the depth from which no photons escape is not fixed: with increased depth, the probability of a photon's escape declines, nearing but never reaching zero. Also, the probability of escape depends upon the Wavelength.
A generally-used criteria is from an Optical Depth (τ) of 2/3 to that of 1, roughly from the depth that most photons come from to the depth at which most photons from below do not escape. In modeling, a more specific criteria may be specified.
ATLAS Stellar Model
Carbonaceous Chondrite (C Chondrite)
PHOENIX Stellar Model
Stellar Temperature Determination