On time = at the planned time; neither late nor early
Peter wants the meeting to start exactly on time.
In time = with enough time to spare; before the last moment
He would have died if they hadn’t got him to the hospital in time
In the end = finally, after a long time
In the end, I got a visa for Russia
At the end = at the point where something stops
I think the film’s a bit weak at the end