cIt's complex, and some of the answers are "soft" and some of you assumptions are (reasonably enough) inexact.
Li-ion are measured in mWh
LiIon cells are frequently measured in mAh capacity.
LiIon batteries (1 or more cells) often have mWh and mAh markings.
Neither is a certain measure of what a user will receive.
Both are useful.
(cf George Box's "All models are wrong, some models are useful")
A LiIon cell have a mean voltage of 3.6 to 3.7V.
If you multiply the mAh rating x 3.6 or 3.7 you get the Wh capacity.
The true Ah capacity of ANY battery depends on usage profile - constant current, constant power, pulsed drain of X amps for xx ms every xxx ms etc.
LiIon is relatively close in mAh ratings across its capacity range compared to some other chemistries.
A LiIon cell in low to medium power applications (eg total discharge times of hours) has Vout of 4.2 V o/c fully charged and say 3V fully discharged at light or typical currents.
Vmean is say 3.6V.
If you discharge at constant power of say 10W then
at 4.2V I = P/V ~= 2.4A and
at 3V I = P/V = 10/ 3 = 3.33 A.
ie a change of 2.5:3.3 ~= 0.75:1 or 1.33.
If a mAh rating is used then a say 6Ah cell will give
t = Ah/I = 6/3.3 or 6/2.5
= 1.8 hours or 2.4 hours at the current extremes, and in practice somewhere in between.
The same cell will probably be rated as Wh = Ah x 3.6V = 6 x 3.6 = 21.6 Wh.
Run time = Wh/P = 21.6/10 = 2.6 hours.
In this case the true run time will probably not exactly match and of the above but is liable to be near or maybe above the 2.6 hour figure.
If discharge was at constant current different calculations apply.
Say we set 10W at 3.6V =~ 2.75A
At 4.2 V, P = V x I = 4.2 x 2.75 = 11.6 W
At 3V, P = 3 x 2.75 = 8.25W
Ah rating gives discharge life of t = Ah/I = 6/2.75 = 2.18 hours
Wh rating gives time of t = Wh/P_V3.6 = 21.6 / 10 = 2.16 hours.
Neither may be correct.
As you draw more current from a LiIon (or any other) cell the voltage will drop. Terminal voltage will depend on state of charge, current, capacity, past history, ... . A voltage is lower or much lower at very high drain, the chosen termination voltage will affect the apparent mAh capacity.
So - a LiIon battery Wh rating from a reputable supplier is the approximate Wh achieved under typical use in a typical application. A battery in a laptop may (or may not) be rated differently than one in an eg power wall, or electric vehicle or power tool.
NiMH are measured in mAh
More liable to be true.
NimH have a far flatter discharge voltage curve across their capacity range.
Usually we take Vmin = 1V or even higher.
Vavg may be around 1.2V at low to medium loads and l.2 - 1.15V as load increases - and lower under very heavy loads.
Alkalines are typically not measured
Datasheets with extensive to extremely extensive information are available from reputable manufacturers. Those who know the fine detail of their requirements and wish to design for an application are generally well served.
Those who wish to pop in a new set of batteries are passed on to the marketing department.
Top AA Alkalines are nowadays about on par mAh wise with the top NimH AA cells.
Actual capacity can depend very substantially on the application and conditions. No/low/medium/high currents, pulsed versus intermittent versus continuous loads and more alter the results.
If you are an end user and you want a well performing battery then "long lasting" and "longest lasting" are less important than the brand name. mAh or Wh ratings would be a guide, but no better than the brand name for most users.
For longest lasting top energy AA cells Eveready Lithium primary cells seem currently to be "it". Other reputable brands products will not be far behind They have a very flat discharge curve at usefully higher voltages than Alkalines across the discharge range.
I personally never buy top brand Alkalines as I have found that "trustable"* volume-sold rebranded Alkalines provide better energy capacity per $.
Usually those sold by larger chain stores or major outlets.
MUST weigh >= 20 grams. 23g better. More again better still.
"New" Alkaline Vo/c:
1.65V+ New new.
1.6 - 1.65 V - 0-6 months. Maybe 1 year since manufacture.
1.55 - 1.6V - 12 -24 months old. Maybe more.
Under 1.55V - NOT Alkaline or very old.