Useful battery life is a function of two main parameters:
The capacity figures for batteries indicate how much current they can supply before they are depleted to the point that the manufacturer does not expect them to be useful for typical applications. A battery's ability to supply power, however, will diminish throughout its useful lifetime, and even batteries that with half of what the manufacturer would regard as "useful" energy remaining may be unable to supply enough power to operate certain devices.
If one wishes to estimate how long a device will operate properly on a set of batteries, and the expected lifetime is sufficiently long that one doesn't want to wait it out, one might start with a fresh battery, drain it about 40% using a resistor or current sink (probably sized to drain over a period of an hour or two), let the battery rest for a little while, and test whether the device still works. Then drain the battery another 5%, test whether the device still works, etc. If one finds that the device starts malfunctioning after one has drawn e.g. 80% of the battery's nominal capacity, then assuming the current draw isn't affected by voltage, one should estimate battery lifetime in days as being 80% of its capacity, divided by the amount of charge the device consumes per day.
Note that depending upon the purpose of the device, it may be helpful to have it drop into a "lower-power" schedule when the battery gets low. For example, a temperature-monitoring device might transmit readings once every minute under normal battery conditions, but once every five minutes once the battery reaches a certain threshold. Such behavior could substantially extend the period of time at which the device could offer some degree of usefulness, at the expense of reducing the time during which it offered full utility.