Senior Member. "By the time" conveys the sense of the duration of time, from the moment of speaking (or singing) those words until the moment of arrival at Phoenix. "When" in the third line conveys the sense of an occurrence at a specific point in time, i.e. the moment at which she reads the note.
Does by the time means before?
"By the time" doesn't literally mean "before" (that is, you cannot replace it with "before" without changing the meaning of the sentence), but it does entail that one thing happens before another. In your example, the bell rings before the speaker gets back to school.
Which is correct in time or on time?
"In time" usually has an implicit "for (some event)", whereas "on time" means "before some deadline". The "event" could be a deadline, but in that case "on time" is much more common. "I got there in time" - meaning "in time for some event which is assumed to be known".