يَسْأَلُ أَيَّانَ يَوْمُ الْقِيَامَةِ
He asks: When is the Day of Resurrection? (al-Qiyāmah 75:6)
Ayyān typically asks about future time. It often has the additional rhetorical color of solemnity or awe, because the event whose time is sought is momentous.
مَتَى يَبْدَأُ الدَّرْسُ؟
When does the lesson begin?
This is an ordinary question about future time.
The Qurʾānic example employs ayyān in relation to the awesome Day of Resurrection. Thus ayyān and matā should not be treated as mechanically interchangeable in every rhetorical setting.