Hi there, things like this are some of the most frustrating things in WF in my opinion. There could be a few reasons:
- Your instance may have a default schedule of 8-5, but in your project preferences in setup, see which selection you have in this area - are there multiple people assigned to the task you are referencing?

- In your specific project details settings, do you have the default schedule applied to the project? Even if you have a default schedule in your instance, you're able to not have specific projects abide by it, so it's something worth checking if your project settings have the schedule in there or not.

- It may have something to do with related tasks' predecessors and constraints. Dependent tasks may be forcing this task to end at 4pm.
- It may have something to do with the assignee's schedule. Do you have user schedules in your instance? If you have user schedules, and the user assigned to your task is assigned to something and has their schedule applied, a user schedule in a specific project will override an instance schedule.
Good luck!