In this article, we present a simple and fast optical method based on transmission microscopy to study the stochastic wetting transitions on micro- and nanostructured polymer surfaces immersed in water. We analyze the influence of immersion time and the liquid pressure on the degree of water intrusion in individual microcavities on these surfaces as well as the lifespan of their superhydrophobicity. We show that transitions among the three wetting states (Cassie, Cassie-impregnating, and Wenzel) occur with a certain pressure threshold (300 mbar for a microcavity diameter of 7.5 mu m). Below this threshold, the transitions between the Cassie and the Cassie-impregnating states are reversible, whereas above this threshold, irreversible transitions to the Wenzel state start to occur. The transitions between the different wetting states can be explained by taking into account both the Young-Laplace equation for the water menisci in the cavities and the diffusion of dissolved gas molecules in the water. In addition, the wetting transitions had a stochastic nature, which resulted from the short diffusion distance for dissolved gas molecules in the water between neighboring cavities. Furthermore, we compared the contact angle properties of two polymeric materials (COC and PP) with moderate hydrophobicity. We attributed the difference in the water repellency of the two materials to a difference in the wetting of their nanostructures. Our experimental observations thus indicate that both the diffusion of gas molecules in water and the wetting properties of nanostructures are important for understanding the sustainability of superhydrophobicity of surfaces under water and for improving the structural design of superhydrophobic surfaces.