In computer programming, cohesion refers to the degree to which the elements inside a module belong together.
Cohesion is an ordinal type of measurement and is usually described as “high cohesion” or “low cohesion”. Modules with high cohesion tend to be preferable, because high cohesion is associated with several desirable traits of software including robustness, reliability, reusability, and understandability. Wikipedia
And, from a gem of software engineering literature (“Structured Design” by Ed Yourdon and Larry Constantine) from 1978:
How tightly bound or related its internal elements are to one another.
Not the same as coherence
Cohesion is a property of a single module: do its elements belong together? For the system-level notion — do all the parts fit together under one set of design ideas — see coherence, which explains the difference.