How do you determine whether surgery for my herniated disc is necessary?

If you are not ... If you are not getting better after 12 weeks of care & the symptoms are such that you cannot or will not live with them & your leg pain is worse than your back pain, if you even have any back pain, ; & your exam reveals findings consistent with a disc herniation & it is demonstrated on an imaging study compressing the appropriate nerve & you are healthy enough for surgery, then you have reason!
Take it slow. In general, it is time to consider surgery only when nothing else helps. Getting yourself fit with low impact exercise (i.e. Aquatic), working with physical therapist and your doctor will make decision making easier. If in doubt, get a second or even a third opinion. Spine surgery is evolving and many exciting options are on the horizon.