Theorie:

Study the information about on time / in time, at the end / in the end.

1. On/in+ time

We use ‘on time’ meaning ‘to be punctual, not late’. If something happens on time, it happens at the time that was planned.

The 10.35 train left on time (=it left at 10.35)
  
shutterstock_1927950590.jpg
 
We use in time when we mean ‘soon enough’.

Will you be at home in time for supper? (soon enough for supper)
  
shutterstock_1932908762.jpg
 
We can say ‘just in time’ in the meaning ‘almost too late’.

We got to the airport just in time to check in.

2. At/in + the end

At the end is used when we mean ‘at the time when something ends’.

At the end of the film
At the end of the month
She is going to Madrid at the end of April.
  
shutterstock_516670732.jpg
 
In the end is used when we mean ‘finally’.
We use ‘in the end’ when we point out what the final result of a situation was.

We had a lot of problems with our flat. In the end, we sold it and bought a house.
 
shutterstock_669633394.jpg