We present a model which explains several experimental observations relating contact angle hysteresis with surface roughness. The model is based on the balance between released capillary energy and dissipation associated with motion of the contact line: it describes the stick–slip behavior of drops on a rough surface using ideas similar to those employed in dry friction, elasto–plasticity and fracture mechanics. The main results of our analysis are formulas giving the interval of stable contact angles as a function of the surface roughness. These formulas show that the difference between advancing and receding angles is much larger for a drop in complete contact with the substrate (Wenzel drop) than for one whose cavities are filled with air (Cassie-Baxter drop). This fact is used as the key tool to interpret the experimental evidence.