I have seen people stop with one finger, two fingers or the whole hands on the levers. Is there a recommended number of fingers on the brake levers when stopping/anticipating an emergency stop? Do brake types or riding style (DH, road ..) affect this number?
For downhill and all forms of trail riding (freeride, enduro, all mountain etc) the prefered way is 1 finger (index) on each lever. Anything else can be dangerous. If the brakes are not powerful enough for dealing with this then they either need fix or replacement to proper brakes for this type of riding.
Also, riders position the levers closer to the stem (leaving 1 to 2 inches space between the grip and lever clamp) in order to enforce that only 1 finger can go on the lever. This also helps the finger pull the lever from its most powerful spot.
I look at it the other way - what's the required number of fingers to maintain a hold of the handle bars. On a sealed road it's close to 0, leaving 4 for braking. In a serious rough/rocky track, it might take four, leaving none for the brakes (along with praying it smooths out soon). Lose the handle bar, you lose brakes and steerage - there's only one way that ends, and you are a passenger. Going too fast with steerage - there is more than one possible outcome, which you have a degree of control over the outcome, and can usually minimize the damage.
Off road, I typically use my outer fingers first - pinky + 1 is the minimum for useful braking, never more than pinky + 2.
In general the fewer fingers on the brake lever the better, as it means more fingers can keep you holding on. However in the real world, it depends on your grip strength and how powerful your brakes are, for how many fingers you can stop with.
On both road and mountain bikes I tend to keep 1 finger ready to brake when I don't think I'm going to need to stop quickly, mostly for feathering my brakes to slow.
When I think there is a more immediate need, such as going down a steep incline on road or technical singletrack section off-road, then I tend to use 2 fingers. This tends to be my default.
Sometimes, I'll use 3 for an emergency stop if I'm surprised, but most of the time 2 seems to be better for that as well.
Some brakes may be easier to pull than others depending on the style and how well they are tuned. Hydraulic disc brakes tend to be the easiest and require less effort (so I use one finger more often).
You could just flip the whole gang the bird and use Middle finger braking.
Throwing in some anecdotal stuff.
I had been fine riding XC with two fingers in the lever (middle+index) but when I began riding DH, I often experienced grip loss of hand / forearm fatigue.
Somehow I discovered that I was way more comfortable using just the middle finger on the brakes. It seems to be that my index fingers are much better gripping the handlebars than actuating the lever. I supposed that lever placement had a role, so I moved the levers towards the stem so I could actuate them with my index finger. The result: I was able to apply the brakes fairly well, but my fatigue problems worsened.
I reverted the setup to actuate the lever with the middle finger. May be just my case, but it happens to be that my middle finger is just stronger applying the brakes. This leaves me with 3 finger in the handlebar: pinky, annular and index, which provides me with enough grip for DH riding. Now I use this technique even in XC or commuting. Results more relaxed to me, less fatigue at the end of a ride or practice session.
So, conclusion after the long fairy tale: **Try different positions at least for a ride or two, the perfect hand grip for you may not be in book! **
Under normal riding situations on paved roads, I always reach for the brake levers with at least two fingers. Just in case you hit a bump and a finger is "jarred" off of the lever, or a finger just slips off of the lever because of sweating, you still have one finger left on the brake lever to exert some braking force to a wheel. Of course, each individual usually will seek whatever feels most comfortable to them. Keeping control is the main thing. On a downhill, you should only need really "light" pressure on the brakes to stay under control. I still use my two fingers for the safety aspect, but "feather" the brakes using one dominant finger.
Professional racers use either 1-finger technique or 2-fingers technique for braking. The 2-fingers technique is more efficient for hard braking and is useful only for racing or riding at high speeds (>200 km/h) while 1-finger braking is smoother and more precise and is useful for normal riding. Furthermore, owner's manual for most bikes advice to squeeze the brake, not grab it and thus instructs to use one or 2 fingers for braking instead of 3 or 4.
Experienced riders know that on a bike, you should squeeze the front brake gradually so that some pressure will push the front wheel onto the ground, thus making a larger contact surface, thus allowing you to squeeze harder without risking the front wheel to block (the front wheel keeps the bike up while it is spinning, so blocking it will make the bike fall in about 1 second)