A lagoon is a body of salt water partly separated from the sea. There's usually some sort of barrier which separates and protects the lagoon. This may be a pebble or shingle beach, sand bank, or perhaps a coral reef surrounding an island (that's called an atoll.)
Lagoon refers both to coastal lagoons, and the lagoons in atolls, formed by the growth of coral reefs on slowly sinking central islands.
Coral atoll formation: corals (in tan and purple) settle and grow around an oceanic island, forming a reef. Often, the reef expands, and the island subsides. Eventually the island beneath the water leaves a ring of growing coral with an open lagoon in its center. The process of atoll formation may take as long as 30 million years.