Although this method is implemented in class Object, it is recommended that you override this method and provide your own implementation for classes you write. Just as it is a good idea to provide your own overriding 'equals()' and 'toString()' methods.
How you implement hashCode() is completely up to you as long as it satisfies the hashCode() contract - you can see this in the java docs API for the Object class.
So for example if you are writing a Time class that holds hours (HH), minutes (MM) and seconds (SS) then your implementation of hashCode() might return the integer represented by HHMMSS or you might decide to return the integer representing the number of seconds past midnight that the Time object represents. It's your choice.
Or in a 'Person' object you might concatenate the Surname with Forename and use
String's hashCode() method to get the integer to return.
So as to the size of the integer - it can be whatever you want it to be.
One thing to bear in mind though is that the way you compute hashcodes could have an influence on the performance of hashtables, hashmaps etc. as it would increase look up times if many unequal objects had the same hashcode.