Dee's given good advice....get "checked out" if your symptoms continue.
Without more to go on, it sounds like you may have strained or bruised your gear within the scrotum by having worn the cockring. (Well, SOMETHING triggered this pain, didn't it?) Cockrings change circulation when they're worn---constain (trap) the blood or redirect it somewhat in a restricted way. There can be consequences wearing a cockring beyond the desired effect, particularly if they're too tight or, worn too long. Circulation being altered (even briefly) can at times possibly set up achiness and other discomfort. Even the cord bundle from each testicle could be sensitive and/or sending "pain" near or within the testicles without them actually being involved necessarily. Watch for undue swelling, continued (worsening) of the tenderness and sensitivity and GO for medical attention. Chances are very good though---even if you seek medical help, what you're experiencing most likely won't prove to be all that serious.
There are a few minor maladies which can occur within the scrotum area for a man beyond injury-related circumstances (i.e. inflammation of the epididymis behind the testicle, for example) which can cause pain. These kind of "male system flare-ups" can be easily fixed with medications (antibiotics) over a few days...no big deal, really. Varicoceles (akin to varicose vein type problems) occur behind the testicles too, and can cause pain, achiness and a dragging "weighty" sensation. These require time to correct on their own. Persistent varicoceles can be treated surgically, as a last resort.
--------
Testicular "lumps" are the main thing to watch for and pay attention to. They typically are painless but can be a matter of concern. While not always cancerous, they can be. I'm mentioning this info for ALL readers to remember. Main point for ANY health issue in the tackle:
Just don't put off seeing a doc....if you need to.
Peace of mind is worth everything concerning that area of our bodies.