This will not always be the case but I tend to see the first sentence as a response for when someone is waiting specifically for the result of the work; and the second sentence when someone is waiting for my availability (e.g. to do more work).
Consider the following conversations:
Alice: Have you finished the TPS reports? Management need to look at them tomorrow morning.
Bob: I'll do them [the TPS reports] by 5 o'clock.
Alice: I need you to start working on the TPS reports. When will you be finished with the aggregations?
Bob: I'll have them [the aggregations] done by 5 o'clock.
That said, both of your sentences can reasonably be used to satisfy the first conversation.
The implicit guarantee, in either case, is that the work will be finished by 5 o'clock. You would nearly always advise the person you were speaking to as to when they should expect that their progress can continue.
If you wanted to express you would still be working on something at 5 o'clock (i.e. it will not be finished), you could use alternatives, such as:
- (if the deadline cannot be met)
- I won't have the work done by 5 o'clock
- It won't be done by 5 o'clock
- (if you haven't started yet)
- I hadn't planned on starting this until 5 o'clock (i.e. by your choice)
- I can't start this until 5 o'clock (i.e. because something else prevents it)
- (if your work conflicts with another activity)
- I'll still be doing the work at 5 o'clock
- I'll still be working on this at 5 o'clock (i.e. so I can't do something else)
- I'll still be at work at 5 o'clock (i.e. so you cannot meet someone elsewhere)