The sealing of the piston against the non moving cylinder wall is done usually by piston rings  touching the cylinder wall. These can be lubricated or non lubricated.
Lubricated piston rings are made of a special type of cast iron. Materials for non lubricated piston rings are: Fluor polymers (e.g. PTFE), Polymer blends (blends of various polymers) and High temperature polymers (e.g. PEEK).
In special cases labyrinth seals are used, which run without touching the cylinder walls.
For dry running piston rings various types of cuts were developed, which warrant the smallest possible increase in leakage with wear. Especially the double overlapping (gas tight) gap and the twin ring system are of advantage in this respect. However, with brittle ring material, the design has to be such that the gap is not liable to fracture.
The necessary number of piston rings influences to a large extent the length of the piston. In splash lubricated plunger piston compressors one or two oil scraper rings are fitted underneath the piston rings.
For the sealing of the piston rod against the cylinder pressure packings are used. These consist of individual cups, which contain 1 anti extrusion ring and 2 split sealing rings.
With non lubricated service the packings have to be cooled. With highest pressure compressors the pressure packing principle also finds application as seal for the piston.
The current state of design of pressure packings for piston rods is described in