For my editorial services, I charge by the word. I have heard of others charging by the hour, with an estimate coming before the agreement to do the work.
The advantage of charging by the word is that it sounds fair. An 80,000-word book works out to this rate or that, depending on the editor. And it is fair, if all authors are created equal.
Charging by the hour is fair, with an estimate, because all authors are not created equal. Some need more help, others need less. But sometimes estimates are too high or too low. They are based on how much work an editor thinks he or she will do with the manuscript.
Perhaps one day I will consider a hybrid of the two approaches.