Piston rings are metal components which wrap around the piston, forming a tight seal around the cylinder wall. There are often multiple rings, each with a different purpose and/or effectiveness. They are always located at the top of the piston, so most of the piston wall can be lubricated.
Some rings are designed to seal off the combustion zone from the other rings, while others are better at holding back oil. The compression rings are usually just solid rings, but the oil control ring has a chamber within it to help provide the cylinder walls the right amount of lubricant. Compression rings are located closest to the compression, at the top of the cylinder, while the oil control ring is found at the bottom.
The piston rings are also important in the transfer of heat, because pistons can't be cooled by fluid, so the metal rings transfer heat to the cylinder wall, which is then cooled by the engine coolant.
The number of rings used differs from engine to engine, and depends on how the engine is used.