"It is getting late, I have to go."
Translation:Il se fait tard, je dois y aller.
In French, you can't say "go" without giving at least a hint of "where".
"Y"stands for "là" or "là-bas", either because the place was mentioned before or just to mean you are getting somewhere.
That is a colloquial expression where the reflexive has the role of a near-continuous meaning:
il se fait tard = it is becoming late (it is being late)
Although this expression has not been introduced yet, I gave the translation "je dois m'en aller" instead of "je dois y aller" and it was accepted. Thinking about it, my version is more like "I have to leave", but anyway.