Snails are members of the class Gastropoda, phylum Mollusca, and thus are not formally considered bugs. True bugs are part of class Hemiptera, which are from the phylum Arthropoda. Informally, however, bugs are considered to include all land invertebrates; in this sense, land snails are included.
The other land-dwelling members of Gastropoda, slugs, are also informally considered bugs without formally being so. Both snails and slugs have marine and freshwater counterparts that are not generally considered bugs in either sense. The class Gastropoda features approximately 65,000 different species; of these, over 30,000 species are adapted to live on land. There are 30,000 species dwelling in ocean habitats, while the remaining 5,000 species are only found in freshwater.