The answer to this question depends on what kind of surgery
you had and when you had it. You will need to ask this question directly to your orthopedic or hand surgeon
the next time you have a visit with them.
One general principle is that vigorous activity (such as swinging a golf club) should not be done until all the pain and swelling is gone and the scar tissue has had time to mature. In most cases this probably means at least 6 weeks, maybe longer, depending again on the extent and type of the surgery.
For example, many people have surgery on their hands for carpal tunnel syndrome
. There are, however, two different types of carpal tunnel surgery. One is endoscopic release which involves minimal incisions and minimal trauma and the other is an open procedure which involves a large incision. Obviously, if you have had the former, your chances of healing more quickly and returning to golf quickly are much better than if you had the latter procedure.
However, this is something that you will have to discuss with the surgeon who performed your procedure, as each surgeon has different preferences about returning to activity in their patients.