A type system is a set of rules within a programming language that assigns a property, called a data type, to various constructs like values and expressions. Its purpose is to categorize data and enforce constraints, aiming to catch errors and ensure predictable program behavior, often through type checking.