Every variable in Java must have a data type that determines what values it can hold and operations that can be performed on it. Java has two categories of data types: primitive and reference. Primitive types represent basic values like integers and characters, while reference types refer to objects. Some examples of primitive data types are int for integers, float for floating point numbers, and char for characters.