"On time" means that something/someone will be somewhere at the agreed upon or established time. For example, when an employee is on time when they are present and ready to work at the time their job begins each day. Or, a train can be "on time" if it arrives at the station it is to be at when it is scheduled to do so.
"In time" can mean a couple of things. First, it can mean in the future. For example, "In time she would grow from a child to a woman". Or, "He would gain much wisdom in time." When the term is used in this way it could be replaced with the phrase "over time" to indicate a process that occurs over time.
"In time" can also be a shortened form of the phrase "just in time". It means to finish something just before it was too late. For example, "He completed his math test just in time", and, "She got to the bus stop in time to catch the last bus before it pulled away."