The two sentences can be interpreted in the following different ways:
I will do the work after an hour.
In other words, I will start the work only when an hour has passed. I may be busy for the next hour and can't start it before then.
🠆 An hour from now: the work will begin.
I will do the work in an hour.
Or, I will start the work at some point within the next hour—and it's also likely I will also have it finished by the time an hour has passed.
🠆 An hour from now: the work will be finished.
That, however, is just one interpretation of the second sentence. In line with how you are likely interpreting it, it's also possible to interpret the second sentence in the same way as the first.
But while do the work in an hour can be meant to say that you'll only start it once an hour has passed, it's not possible for do the work after an hour to be interpreted as meaning that the work will be finished by the time an hour has passed.
If you want to avoid all ambiguity with the second sentence, you could say one of the following instead:
I will start the work within the hour.
I will finish the work within the hour.
(The choice between the two depends on how specific you want to be about how long it will take you and when you think it will be completed.)