Compactness is supposed to be a measure of the regularity of a shape. That is quite agreed upon, but looking around I have found several different ways to put a number to it. It usually is Perimeter/Area or some variations to the theme (multiplying by a constant or squaring the perimeter).
Circles have very low compactness and rugged shapes high (infinite in fractals).
Anyway, it is a term that crops up in Computer Vision, particularly in segmentation, as it can be one useful measure for classifying blobs (e.g.: analyzing tissue cells, rugged cells could be unhealthy and smooth ones good).
Compactness is also a good example for illustrating abstract methods in object oriented programming. If we've got an abstract shape class, and things like squares, triangles, and the like as subclasses, we would habitually define area and perimeter as abstract methods (because we can't calculate them generally), but we could have compactness defined using those abstract methods.