Reproduction

Sexes:

While most prosobranch snails have separate sexes (there are males and females of them), as well certain opisthobranch sea slugs as pulmonate land and fresh water snails are hermaphrodites, they have male as well as female genital organs in a genital apparatus.

More about the Roman snail's reproduction
More about the Roman snail's genital apparatus

Mating and fertilisation:

Fertilisation takes place externally in the water only among certain archaic prosobranch snails (Patellogastropoda). Sperm and egg cells are released into the water and fertilisation is a matter of chance.

Banded snails (Cepea nemoralis) during the process of copulation.
Picture: Andreas Heidl Nature Documentations. 

 
Among the more highly developed snails fertilisation takes place internally in the female or at least in the snail acting as female. For that to be possible, fertilisation has to be preceded by a copulation, during which sperm cells are transferred to the sexual partner.

Hermaphroditic snails can copulate mutually (and usually do so).

A snail's fertilisation by itself mostly is prevented by the development of sperm and egg cells, which, passing hermaphroditic areas of the genital apparatus are unripe and ripen only when those areas used by male as well as female genital cells are passed. Besides self-fertilisation is not feasible, as it not provides a mixing of genital information and so to the greatest extent hinders variation. Variation on the other hand is one of the most important motors of evolution. Organisms reproducing solely by self-fertilisation (parthenogenetically) have a very low variation only based on mutations occurring during the embryonic development. That is why most species, that reproduce parthenogenetically, at another time of their life also reproduce sexually (see generation cycles of trematodes).

During mating, a sperm cell packet, the spermatophore, is transferred to the partner.

  Whelk lay their eggs in packets of egg capsules.
The advantage of an internal fertilisation on first hand is that all gametes (genital cells) reach the partner. In external fertilisation that is left to chance. It makes necessary the production of very high numbers of gametes.

On the other hand the advantage of an internal fertilisation is that fertilized egg cells can be processed to be eggs. They can be provided with additional nutritive cells (yolk) as well as with protective coats, such as egg shells (terrestrial snails) or egg capsules (many sea snails, such as the whelk). This is, of course, impossible in case of an external fertilisation, as then fertilisation would be impossible. Those additional protections of the egg cells minimize the necessary number of egg cells (respectively eggs that have to be laid).  So the evolutionary advantage is the energy that can be saved, and the greater safety of the offspring.