The `Asr (Afternoon) Prayer becomes due when we are attending a lecture at the faculty. The professor is Christian, and does not give us a chance to offer the Salah (Prayer). Thus, we offer it when we leave, when there is only one hour left before the Maghrib (Sunset) Prayer.
It is better for you to offer Salah at the beginning of its time, but your offering of Salah at the time you mentioned is valid and falls within its due time. It is not permissible to delay the `Asr Prayer (Part No. 6; Page No. 121) until the sun has become yellow (pale), based on the following Hadith Sahih (authentic Hadith) related in this regard. On the authority of
`Abdullah ibn `Amr ibn Al-`As (may Allah be pleased with them) - as related by
Muslim and others (may Allah be merciful to them) - who reported that the Prophet (peace be upon him) said:
When you offer the Fajr (Dawn) Prayer, its time is until the first horns of the sun has risen. When you offer the Zhuhr (Noon) Prayer, its time is until the time for the `Asr arrives. When you offer the `Asr Prayer, its time is until the sun turns yellow (pale). When you offer the Maghrib Prayer its time is until the twilight goes. When you offer the `Isha' (Night) Prayer, its time is until the middle of the night.
May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.