I went through this about 12 years ago after dislocating my right shoulder more than 10 times. It got to the point where I would wake up in the middle of the night with it popped out because I moved the wrong way. The surgery will vary depending on the amount of damage done and the reason for your particular dislocations. In my case, the labrum was repaired, and I was found to have a Hills-Sachs lesion (a deformity on the ball of the humerus caused by repeated trauma over time). To keep this from causing further dislocations, my subscapularis muscle was tightened by about a cm, restricting external rotation in my shoulder.
It was a very painful surgery and I was kept in the hospital overnight. I have a feeling that methods have probably come a long way since then and it might not be so bad anymore. I have a 6 inch scar running down the front of my right shoulder. Recovery took a long time. I was out of the gym for six months and didn't train heavy for a while after that.
I still deal with pain in the shoulder and it does sometimes limit my training a bit since I don't have the flexibility to perform certain movements (like flat barbell bench press for instance), but my shoulder feels tight and strong still. Overall, I'm glad I had the surgery done. It's very unnerving to feel like your shoulder is loose and unstable and could dislocate at any time. Just remember, the longer you wait to have it looked at, the worse it's going to get. More damage is done every time the shoulder dislocates.
Hope this helps.