Q:

How does Imperial Luck work?

Imperials have a racial trait called Imperial Luck: "Anywhere gold coins might be found, Imperials always seem to find a few more." 
Most specifically, what is the maximum amount of gold that one can get before unlocking the door with the Helgen Keep Key or killing the first two enemies? The second chest-from-the-door-that-one-enters-to-choose-Hadvar can spawn with gold in it, which seems to be the only thing that Imperial Luck affects that far. (There always seems to be four Septims on the table and no gold in any of the other chests.) 
The UESP entry states, "100% chance of 2-10 extra gold in all chests that normally contain gold", but I've found from zero (0) to nine (9) Septims in the chest, shaking the credibility of UESP, or at least that one statement. 

A:

Initially, I looked into the Creation Kit for an answer:

In the screenshot we can see the LeveledItem called LootImperialLuck. This is the ability Imperials have.

Since all the Levels in the table are similar, the LeveledItem upon activation will select one of those. This means that, in addition to the leveled loot already in a given container, those blessed with Imperial Luck will get 2-10 gold (each amount having a 100/9 % chance).

This seems to confirm the description given in the UESP entry.
Some additional information:

The Calculate for each item in count option is ticked. As far as I know, this means that the chance of this ability (or the additional 2-10 gold pieces) being considered, is independent of the chances already calculated for the rest of the (default) loot (more on that here).
The Chance None value (100) is determined by a Global value. This refers to the Global ImperialLuck, which is set to 100, when, according to the UESP, it is inactive (since "using the console command set ImperialLuck to 100 disables the perk").

This use of values, which is counterintuitive, is more elaborately explained here:

Think of drop tables like throwing dice which can land on any number
  from 1-100.  If a container has a 30% chance of having an item:
  1-30 = item is spawned
  31-100 = item is not spawned

That blog post offers a very good readup on the four perks most directly involving finding more loot, among which is Imperial Luck (the others are Prowler's Profit, Golden Touch, and Treasure Hunter). Building on the information on the ability already given here, its description of Imperial Luck offers some new insights - disproving the common description in the process:

Imperial luck gives the player a varying number of dice rolls for each
  type of container.  The basic breakdown is as follows:
5 rolls - BOSS chests (except Falmer BOSS chests which give 1)
2 rolls - REGULAR chests 1 roll - All urns (except 'EMPTY' urns)
1 roll - Draugr corpses (the ones that don't come to life)
0 rolls - Dwarven chests (because screw you!) [and Strongboxes]
   
From what I can tell every roll has an equal
  chance at landing on each of the 9 spots (meaning if one lands on '9
  gold' it isn't eliminated).  Over a large enough sample size you can
  expect each roll to average an extra ~6 gold for you, so BOSS chests
  will average ~30 gold and regular ones ~12.

And, concluding:

I couldn't really find any information on what this power actually did other than most people citing that it adds 2-10 extra gold to a chest, which is not accurate.  A pleasant surprise to me, the power is actually a lot more useful and profitable than I thought.

What's most interesting though, and what I found out about the latest (which is confirmed in that same linked post) is that every single player character starts out with Imperial Luck (Imperials have the exclusive racial ability that they are able to see it under their active effects) +. So comparing differences between an Imperial and a non-Imperial player character, to get an idea of the functioning of Imperial Luck in the vanilla game, is fruitless to begin with.
This bug is fixed by the Unofficial Patch (LE / SE).

+ Further down that thread:
"For clarity, in case anyone is wondering, the 'BUG' we're talking about is when you leave the Helgen cave at the start of the game a 'check' is done where certain racial powers/abilities are applied, one of which being the Imperial ability of 'Imperial Luck'.  Bethesda being the top notch QA testers they are forgot to include a keyword that would make the game only apply the ImperialLuck if your character is flagged as an Imperial thus every character is given this power."

