Purusha has two distinct careers in Indian thought, and they are worth keeping apart.
In the Rigveda, the Purusha Sukta (10.90) describes a cosmic Person sacrificed by the gods, from whose dismembered body the world and its orders are produced: the moon from his mind, the sun from his eye, the sky from his head, and the four social classes from his mouth, arms, thighs and feet. This is among the earliest textual references to the varna scheme, and the hymn has been intensely contested in the modern period, cited in defence of a divinely grounded social order, and rejected by B. R. Ambedkar and by anti-caste movements as the ideological charter of a hierarchy they hold to be entirely human and unjust. Historians of the text generally regard the hymn as late within the Rigveda and as reflecting a developed priestly ideology rather than the earliest layer of the collection. The image of a world produced by dismembering a primal being is a recognised comparative type, with Norse Ymir and Chinese Pangu as the standard parallels.
In Samkhya, purusha is something quite different: pure consciousness, the witness, wholly inactive and unchanging, radically distinct from prakriti, which does all the acting. Samkhya holds that purushas are plural, one for each living being, which separates it sharply from Vedanta's single Brahman; its argument is that birth, death and experience are distributed among individuals rather than shared, which a single consciousness could not account for. Purusha does nothing whatever, and bondage is therefore not something that happens to it but an apparent conjunction that discrimination dissolves. Yoga adopts the scheme and adds Ishvara as a special purusha never touched by affliction, action or its results.
The two senses converge in later theistic usage, where Purushottama, the highest Person, becomes a title of Vishnu. The Bhagavad Gita's fifteenth chapter uses it to distinguish the perishable, the imperishable, and the supreme Person who is beyond both, a synthesis that takes Samkhya's technical vocabulary into a theistic frame. That synthesis is one reason the term is distributed so widely across traditions that otherwise disagree about nearly everything.