A critical limitation for the application of optical diffraction gratings in high performance spectrometry is their stray light behavior. Current space projects within the frame of the 8th earth Observation program governed by the European Space Agency (ESA) have strong demands on both deterministic stray light artifacts (Rowland ghosts) as well as the diffuse stray light background. However, up to date, the stray light generating mechanisms in gratings are poorly understood and there is a need for models that allow a correct prediction of the scattered light distribution. The aim of this work is to bridge that gap by categorizing the multiplicity of different stray light sources and analyzing their impact on the stray light performance of the grating (regardless of the fabrication technology). Further, on the example of electron beam lithography and based on the derived models, the stray light sources of the used e-beam writer Vistec SB350 OS will be identified and methods for improving the stray light performance will be deduced. Accordingly, this work is divided into 2 main sections. The first part concerns about deterministic shape deviations of the realized grating structure from the desired one. Here, especially large-scale segmentation errors leading to a super period and therefor to Rowland ghosts within the stray light spectrum are investigated. The second part (Chapter 4) is dedicated to stochastic shape deviations, which generate a continuous stray light background. In particular, this chapter focuses on line edge roughness (LER) of the grating lines as this disturbance is of critical interest in both scientific research and technological applications. On the basis of the derived models, the stray light behavior of binary gratings is systematically investigated. On the example of a current high performance spectrometer grating, it is demonstrated that the stray light characteristics can already be considered within the grating design process.