What is it when I have a sharp pains fromtimeto time behind my balls when I sneeze?

Muscle spams. This is likely cramping of the perineal musculature after the sneeze. It is a normal reflex to contract the pelvic floor muscle to prevent the involuntary loos of urine or stool which large increase in abdominal pressure (cough or sneeze). This is the basis of the kegel exercises. I recommend seeing your urologist to make sure this cramping is not from something else.
Just a strain. There can be a lot of stress on the perineal body, which is at that location (google it for a picture). Many muscles come together at that one point and sudden increases in abdominal pressure can pull on it pretty hard. The good news is that it isn't dangerous, the perineal body is incredibly strong.