The Photosphere is the layer of the star from which light propagates, i.e., Plasma/gas from which Photons directly leave the star. Often the term is used to represent a specific level (infinitely thin) rather than a finite layer. Beneath the photosphere, photons are generally captured by atoms before leaving the star. The photosphere is the lowest layer of the Stellar Atmosphere, which term also includes the layers above the photosphere, such as the Chromosphere.
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.
The generally used criteria for the level of the photosphere (as a "surface" with no thickness) is an Optical Depth of 2/3, roughly the median depth from which photon leaving the star came from. The Temperature at that level matches the Effective Temperature, according to analysis using the Local Thermodynamic Equilibrium, the Eddington Approximation and Plane-parallel Atmosphere simplifications.
When considered as a finite layer, typical is to use the layer from that depth down to an optical depth of 1. In modeling, a more specific criteria may be specified.