If you have no work to be done in that hour and the boss lets you leave, there is no blame on you. But the boss has to fear Allah and strive to do what is in the best interests of the work, so as to fulfil the trust that has been given to him.
Shaykh Ibn Baaz (may Allah have mercy on him) was asked about an employee who, when he has finished the work he has, leaves before the workday is over, especially in Ramadan. Is that permissible?
He replied: It is not permissible and what he has to do is to stay at work until the workday ends, unless he has permission from his boss, because new work may come along and he may be needed for it. So the employee has to stay at work until the workday is over, unless he has permission from the state or from his boss.
End quote from Fataawa Noor âala al-Darb.
But if the work requires you to be present during this hour, you do not have the right to leave, even if the boss gives you permission.
Shaykh Ibn âUthaymeen (may Allah have mercy on him) was asked about a man who asked permission from his direct superior to leave work, and he gave him permission. What is the ruling on his salary?
He replied: If you ask him for permission and you know that the work requires you to be present, then you should not accept the permission from him and you have to be present even if you were given permission to leave. But if the work does not need you and you are given permission by the owner of the business, then I hope that there is nothing wrong with that.
End quote from Liqaâ al-Baab al-Maftooh, 14/question no. 17
And Allah knows best.