This question has been asked a hundred times before. :)
When we use "in time", there is a deadline and whatever we need to do is done before that deadline.
When we use "on time", there is an appointed time and we arrive at that time. If the action happens before the appointed time, then we say "early".