A bivvy bag is a waterproof, windproof outer shell you climb into, either around a sleeping bag or on its own in an emergency. The lightweight emergency versions are a metallised or foil-lined sack that packs to the size of a fist, weighs well under 200 grams and costs only a few pounds; the more serious breathable versions cost more and are meant to protect a sleeping bag from rain and ground damp. On its own a bivvy blocks wind and rain and reflects some body heat, but it provides very little insulation, so a night in just a bivvy is about survival rather than comfort.
A thermal sleeping bag does the opposite job: it is built to insulate. Layers of synthetic fill or down trap warm air around you, giving genuine, rated warmth for a set temperature range, and a good one keeps you comfortable through a cold night indoors or out. It is bulkier and heavier than an emergency bivvy, costs anywhere from around twenty to well over a hundred pounds depending on its temperature rating, and — crucially — offers no waterproofing on its own. Down bags in particular lose most of their warmth if they get wet. The two are designed to work as a system: the sleeping bag keeps you warm, the bivvy keeps the sleeping bag dry.