"I'm on time" would the correct answer to your example. However, it would be correct to use "in time" for similar answers like Cheska suggested: "I'm just in time". We use on time to talk about timetabled events. If something is on time, it means that it is at the scheduled time. In this case, you are saying you are attending class at the agreed time. We use in time to say we are not late and have enough time to do something. In this case, "No, no, no, I'm in time for class." We often use the phrase just in time to emphasise that we have time to do something but are almost too late. Have I made the difference clear?