There isn`t much of a difference but on time is more commonly used as an expression and means a due date and time was met or satisfied.
Example: I handed the project to there teacher on time.
He made it to the bus stop on time.
In time usually refers to doing something in a limited amount of time or as an expression to show that it (or something) was completed with very little time to spare.
Example: ``He made it just in time, to the the bus stop``
The goalie stop the ball just in time.
or
The class was given 10 minutes to finish the test and all the students finished in (the given) time.
However for the most part they are interchangeable.