You can use the Set Work option in tasks to set working hours for the task. This can be done in the following 3 ways:
You can edit the set work hours option in tasks if required. In the Task details page (Click open a task to view its Task details page) of the selected task, edit the Work option available in the bottom right and select Set task duration as work in Update Work, to revert the work hours, to task duration. Also in the Classic view, you can edit the WORK column inline and select Set task duration as work in Update Work.
In the Classic view of tasks, you can view the planned work hours and actual hours taken to complete the task. The Work and Time Log columns indicate if you have logged less or more hours than the planned work hours. A green arrow in the Time Log column indicates that you have logged less than the planned hours displayed in the Work column. And a red arrow indicates that you have exceeded the planned hours.