مَتَى جِئْتَ؟
When did you come?
Here the speaker seeks the past time of an event. An answer might specify yesterday or last Monday.
وَمَتَى تَذْهَبُ؟
And when will you go?
The action lies in the future, so the missing information is the time of a forthcoming departure.
Matā can ask about either past or future time. This differs from ayna, which seeks location. Accurate analysis begins by distinguishing the time-frame of the verb from the temporal information the question requests.