If I had a hernia surgery in my groin, how long till I can go back to work (not a lifting job)?

Soon. If your job is not strenuous, you should be back within a week or two. You should discuss this with your surgeon.
Ask Your Surgeon. If your job does not require much exertion, pain is the limiting factor deciding when you can return to work; in essence, my patients tell me when they can return. On average, most can return within 1week after laparoscopic repair, and within 2 weeks after open repair. Of course, your surgeon knows exactly what your repair involved and is best-suited to answer this.