I agree with Art’s explanation, but I’ll add that in time does not have to be connected with any kind of schedule at all, whereas on time is always connected with a precise, scheduled time.
On time means punctual/exactly at the time scheduled.
Here is another example for in time:
Imagine there is an automobile accident. The driver is still inside the car, only slightly injured, but unconscious. You were nearby when the accident happened and you pull the unconscious person out of the car. A few minutes later, the car explodes and burns. You managed to pull the injured person out of the car b in time[/b]. In other words, if you had waited for additional help, it would have been too late to save the person because the car would have exploded and burned with the person still inside.
The main difference between in time and just in time is that there is less time between just in time and “too late”.
Just on time doesn’t exist as a standard phrase and doesn’t really make any sense to me.