Anytime you need to use a reference type (that is, an object - say Integer) as opposed to a primitive type (say int).
This is used, prominently, in generics where you need to specify a class as opposed to a primitive:
HashMap<String, Integer> foo = new HashMap<String, Integer>();
Here, you might think that:
HashMap<String, int> foo = new HashMap<String, int>();
would work, but it won't, as int is not a reference type (a class) but a primitive.
We have wrapper classes for all primitive types:
Integer for int, Byte for byte, Double for double, Character for char, etc.