All vertebrates, segmented worms, such as earthworms, and cephalopods, such as squid, have closed circulatory systems. Closed circulatory systems allow larger animals to be much more active than those with open circulatory systems, which are relatively inefficient in delivering oxygen to the organs and muscles.
Circulatory systems are necessary for any organism that is too large for oxygen and nutrients to diffuse from their body surfaces or digestive system to their cells. There is a large amount of variation in the efficiency of closed circulatory systems. Fish have only two chambers in their hearts, an atrium and a ventricle. The atrium receives blood from the body, while the ventricle pumps it out.
In fish, the blood arriving into the heart is deoxygenated. The heart pumps this blood to the gills, where it is oxygenated, and then to the rest of the body. Amphibian hearts have three chambers and receive oxygenated blood from the lungs into one atrium and deoxygenated blood from the body into the other. They both empty into the same ventricle, however, and some mixing occurs. Most reptile hearts have a similar configuration, except for a partial divide in their ventricles that reduces mixing. Crocodilians, birds and mammals have four-chambered hearts that prevent all mixing.