My mate’s done his a few times, took him anywhere from 3-6 months, and then it was just light riding in the park until it was strong enough.
I would like however to stress (before anyone comes up with “I went back on in a few weeks, did me no harm” responce), whatever time your doctor gives you, DO NOT do anything before then, and take it easy for a while (i.e. don’t go smashing up CwmCarn DH the day after being told it’s OK to ride)
This same mate knew someone from back home who didn’t take that advice, ended up weakening the shoulder joint and eventually had to have an operation. That gave him a 1-year recovery period, but he rode again after 6 months and now has permanent damage that no op can ever fix.
…on a more cheerful note, just take things easy, keep yourself entertained however you can (books, XBOX if you can, Top Gear repeats on Dave, go for a walk, etc.) and all will be fine! If you’re off work (which would be a good distraction otherwise), now’s a good time to order a DVD box-set or two of something you’ve wanted to see for ages but never got round to. Worked for me when I broke my wrist (though the recovery time was only 2 months, 1 of which was making my wrist strong enough to ride again).