Superhydrophobic surfaces can retain gas pockets within their microscale textures when submerged in water. This property reduces direct contact between water and solid surfaces and presents opportunities for improving hydrodynamic performance by decreasing viscous drag. In most realistic applications, however, the flow regime is turbulent and retaining the gas pockets is a challenge. In order to overcome this challenge, it is crucial to develop an understanding of physical mechanisms that can lead to the failure of superhydrophobic surfaces in retaining gas pockets when the overlying liquid flow is turbulent. We present a study of the onset of failure in gas retention by analysing direct numerical simulations (DNS) of turbulent flows over superhydrophobic surfaces coupled with the deformation of air–water interfaces that hold the gas pockets. The superhydrophobic surfaces are modelled as periodic textures with patterned slip and no-slip boundary conditions on the overlying water flow. The liquid–gas interface is modelled via a linearized Young–Laplace equation, which is solved coupled with the overlying turbulent flow. A wide range of texture sizes and interfacial Weber numbers are considered in this study. Our analysis identifies flow-induced upstream-travelling capillary waves that are coherent in the spanwise direction as one mechanism for failure in retention of gas pockets. To confirm physical understanding of these waves, a semianalytical inviscid linear analysis is developed; the wave speeds obtained from the space–time correlations in the DNS data were found to match with the predictions of the semianalytical model. The magnitude of the pressure fluctuations due to these waves was found to increase with decreasing surface tension, and increase with a much stronger dependence on the slip velocity, when all numbers are reported in wall units. Based on a fitted scaling, a threshold criterion for the failure of superhydrophobic surfaces is developed that is based on estimates of the onset condition required for the motion of contact lines. The second contribution of this work is the development of boundary maps that identify stable and unstable zones in a parameter space consisting of working parameter and design parameters including texture size and material contact angle. We provide a brief description of previously identified failure modes of superhydrophobic surfaces, namely the stagnation pressure and shear-driven drainage mechanisms. In an overlay map, the stable and unstable zones due to each mechanism are presented. For various input conditions, we provide scaling laws that identify the most critical mechanism limiting the stability of gas retention by superhydrophobic surfaces.