A common phrase using "in time" is "just in time," which is used when you barely make the deadline of something. For example:
"I drove home quickly and got home just in time for dinner."
You use "on time" for things like homework assignments or other due-date related activities. Example;
"I turned in my homework on time."
"If you aren't home on time, you will be grounded for a week."
In these sentences, "in time" and "on time" would not be interchangeable. If you want to use "in time" in the homework sentence, you would need to include "just" in order for it to sound correct. "I turned in my homework just in time."