Length of rehab depends on a few things:
1. How strong you are going into surgery.
2. How bad your shoulder is to begin with.
3. The kind of procedure you actually have to have done.
4. How much pain you're in after surgery.
I went to rehab twice per week for 3 months at the Boulder Center for Sports Medicine (they're totally dialed) and then continued for another few weeks after that at once per week.
I did the nerve block for the surgery which was great then but post op I was in a lot of pain. At about 2 weeks after surgery, I developed serious neck and upper back pain from guarding the injured shoulder. That was terrible. I then developed headaches - I'm talking the kind where you wake up with a headache, have one all day, go to bed with a headache and then do it all again the next day. It was miserable. Almost nothing worked on them - pain meds, ibuprofen, ice, etc. What finally made them go away was lots of soft tissue work (massage), which is why I continued rehab for the additional period of time, and five visits to an osteopath.
Surgery is a big decision and not to be taken lightly. However, it was a great option for me. I'm back on the water (and the ski slopes) and generally don't worry about my shoulders.
Based on my experience (and that of all the ortho docs I've seen over the years), I would NOT have surgery if you've only dislocated once. My left shoulder popped out in college while creek boating in the Smokies and after 2 months of rehab, it was almost 100%. Granted, I was in my early 20's but it was fine nonetheless. I'd wait until it pops one more time and then consider surgery.
As for exercises/info, here are a few good links:
If you're young, healthy and dedicated to rehab, you should be back on the water in 2-4 months.