Try supporting your testicles in your hand to see if the pain goes away. If it does you may have an infection like epididymitis and should take some antibiotics. It this doesn't help, you may have testicular torsion or another problem.
Either way,
Good Luck