As [Jesus] sat on the Mount of Olives, the disciples came to him privately, saying, “Tell us, when will these things be, and what will be the sign of your coming and of the close of the age?” (Matthew 24:3)
It is true that the disciples did not seem to understand that Jesus had to leave them. But coming does not necessarily imply leaving — for example, the same Greek word which is translated “coming” above is used in 2 Peter 3:12 of the coming of the day of God’s judgement, yet that day had never “left”.
Jesus had spoken previously about his coming to his disciples. For example, just a few verses earlier he says:
For I tell you, you will not see me again, until you say, ‘Blessed is he who comes in the name of the Lord.’ (Matt 23:39)
He also encouraged them to pray for the Kingdom to “come” (Matt 6:10) and talked about the Kingdom of God “coming” (Matt 9:1; Lk 17:20;23:42). Most likely the disciples thought of his coming (and the coming of the Kingdom) as the time when Jesus would overthrow the Romans and make Israel an independent kingdom again (see their comment in Acts 1:6).