Any animal that spends a significant portion of its active life on land must have a means to extract oxygen from the air. Soft gills that work fine in water are not very useful in the air because they collapse under their own weight. Many semi-terrestrial intertidal marine snails, for example, the littorinids (here and here), have lungs. Their evolution has satisfied one requirement of being terrestrial.
The largest group of land snails, the Pulmonata, or the pulmonates, receive their name from the Latin pulmo (lung).
"The primary requirement for a body appendage or evagination to be identified as a gill or ctenidium is the high vascularization of the respiratory surface. The same is true for the lung….In Pulmonata the 'lung' is in fact a bag-like cavity with blood vessels disposed as a network in the roof."
Ghiretti & Ghiretti-Magaldi, 1975
In the back-lighted picture above, the highly vascularized lung of the terrestrial pulmonate snail Novisuccinea ovalis stands out. The snail’s lung, located at the top of its mantle cavity, takes up almost all of its body whorl. The large surface area of the lung is essential for efficient gas exchange. The pulmonate lung opens to the outside thru a single hole, the pneumostome.
Ghiretti & Ghiretti-Magaldi. 1975. Respiration in Pulmonates, Fretter & Peake, eds. Vol. 1.