How long does it take to replace bottom bracket bearings? Is there anything that can make the procedure take more or less time? How does the type of mechanism affect repair time?
There are three main categories of bottom bracket, adjustable type, cartridge-style, and external-bearing. Cartridge-style bottom brackets are not serviceable, the replacement requires replacing the entire bottom bracket assembly. Removing the cranks and installing the new bottom bracket is a pretty straightforward task, and should take less than 20-30 minutes. Adjustable-type can require a little bit of time to get the tension right, plus they are typically more difficult to remove due to the fidgetiness of lockring spanners and the fact that the fixed-cup is typically seized hard into the frame. I'd allot ~45 minutes to an hour for that task. Depending on the brand of cranks, external-bearing splits the difference - some have more steps than cartridge bottom brackets, some are equally simple.
Note that in all cases, using the correct tools is important.
Lots of cranks are cartridges, even when the wheel bearings are loose balls.
Otherwise, it's a relatively simple process to pull apart the bottom bracket. Probably takes less than 5 minutes to get the cranks off and the cup out, unless something's stuck. Then clean things up and pack in the new bearings and grease. (This is where I can't guess, since with my tremor it takes 4 times as long to count out the bearings as it would someone else.) Another 5-10 minutes to put the cup and lockring back properly adjusted, put the cranks on, and torque things up.
A cartridge replacement would be about the same, only it skips that middle part.
Best case is in a workshop, surrounded by all required tools, with a showroom full of every conceivable 'Shimano' spare next door, this is a ten minute job. That is with pressure on (customer getting while-you-wait service for some reason) and a simple swap-over of new parts. This used to be a fairly common procedure in the early days of mountain-biking before cartridge bottom-brackets became available.
Inevitably this would be nearer half an hour if time is taken into account for customer service, i.e. extracting money from customer's wallet, allowing them time to decide whether or not they wanted the XT bottom bracket and so on.
I would not be surprised if it took seconds rather than minutes (or even hours) to put the original bottom bracket in. So the best-case workshop time is slow.
As for one's own bike, even with extensive workshop experience, give it a whole weekend. And maybe the next.
First you have to get the parts off with tools that you have lost somewhere. This means a major clear up. Then the tools (if they fit) don't work too well as something on the bike has corroded. A sit down with a cup of tea (maybe watching the Grand Prix) later, they still don't come off, but perhaps enough bits come out for a visit to the bike shop to get the right spares. It being a busy weekend it can take a long time to be served and with parking, another hour goes by.
Finally, after much physical effort the parts come out. Then it suddenly makes sense to tidy all the components and frame to pristine, as-new condition. Obviously this is needed, isn't it?
Then you find that you read the axle length correctly but the one in the box differs from what it says on the box. Another trip to the bike shop. Because your bike is different, a special order has to be made, or you are forced to buy the deluxe version, perhaps with a whole new chainset.
Finally it takes five minutes to put the part in, another twenty minutes of ride to make sure the front gears are working properly, another ten minutes of tweaking and another quick polish of the bike, perhaps taking time to touch up the paint from where it got brutalised earlier.