The name snail applies to most members of the molluscan class Gastropoda that have coiled shells, but the word is most often applied to the various species of pulmonate land snails, which live in almost every kind of habitat, from deserts and mountains, to marshes, woodland, and gardens.
Snails in the wider sense can be found in an even greater range of different environments: the great majority are marine, but many are terrestrial, and numerous kinds can be found in freshwater and even brackish water. Most snails are herbivorous, though a few land species and many marine species are omnivores or carnivores.
Gastropod species which lack a conspicuous shell are commonly called slugs. Land slugs and sea slugs occur within various larger taxonomic groups, many of which include shelled species. In other words the reduction or loss of the shell has evolved many times independently, within several very different lineages of gastropods.
Although the average person is perhaps more familiar with terrestrial snails, these are in the minority. Marine snails have much greater diversity, and a greater biomass. Snails which have a lung belong to the group Pulmonata, while those with gills form a paraphyletic group.