"on time" is used when there is a specific time you are expected. The opposite of being on time is being "late."
"in time" is used to mean that you arrived before some other thing is going to happen. If you don't get there, you will miss whatever it is that is happening. The opposite of being "in time" is being "too late."
If I say "Meet me here promptly at 8" and you are there a
on time - at or before a prearranged time - not late.
(just) in time for; in time to; in time (for/to implicit) - at or before it is time for some event or to do something - with a little time to spare before something else begins - not necessarily prearranged - usually not prearranged.
-- Hurry up if you want to be on time. The plane leaves at
Another way to explain the difference -- suppose the place is supposed to leave at 8 p.m. You get there at 8:15, so you are not on time -- you are late! But the departure has been delayed until 8:20, so you are actually justin time to get on the plane before it leaves.
Another example -- "Did you get there in time to see the race?" "No -- I was there exact