This study shows why and when optical systems need thickness as well as width or area. Wave diffraction explains the fundamental need for area or diameter of a lens or aperture to achieve some resolution or number of pixels in microscopes and cameras. This work demonstrates that if we know what the optics is to do, even before design, we can also deduce the minimum required thickness. This limit comes from diffraction combined with a concept called overlapping nonlocality C that can be deduced rigorously from just the mathematical description of what the device is to do. C expresses how much the input regions for different output regions overlap. This limit applies broadly to optics, from cameras to metasurfaces, and to wave systems generally.