Both terrarium and vivarium are closely related in both name and definition so it is easy to get the two confused.
Terrarium and vivarium both use the Latin suffix arium meaning "container", but the prefixes describe what they are supposed to contain; terra meaning "earth" and vivere meaning "to live". Although both environments contain plants and earth, terrariums are designed to raise plants, whereas vivariums are considered habitats for an animal.
Terrariums are often a sealed glass or plastic container that host plants.
Vivariums also contain earth and plants, however, they often use pumps, filters, external light sources, microfauna, and they house animal(s). The humidity, watering frequency, and light levels are a delicate balance in a vivarium as you need to accommodate both the animal(s) inside, as well as the plant life.
Here are some "ariums" and their uses:
Terrarium - terra meaning "earth"; a container of earth and plants.
Vivarium - vivere meaning "to live"; a terrarium where the primary focus is on the animal(s) enclosed.
Aquarium - aqua meaning "water"; these environments are fully aquatic (not to be confused with a paludarium). Can be either fresh or salt water. Used to raise and observe all manner of fish and aquatic animals.
Paludarium - palus meaning "swamp". Contains both land and water, usually 50/50 split. Used for semi-aquatic animals such as amphibians.
Riparium - ripa meaning "river". SImilar to a paludarium, they also contain land and aquatic elements. However, the land is used to create a shoreline or riverbank. Has more water than land.
Mossarium - A dedicated container for moss. I personally love moss and I would live in a house made of moss if I could.
Does it matter which term I use?
It can be argued that vivariums are terrariums and vice-versa. It isn't a strict rule and most people will still understand what you are referring to if you use the terms interchangeably.