If you're the top, it's from your balls bouncing off ass for so long.
If you're the bottom, it's most likely epididymitis. Go get an abx Rx. If you want to double check this, cup your balls and lift them upward. If the pain substantially lessens or goes away completely, it's definitely epididymitis. It's called "Prehn's Sign" and essentially guarantees that its epididymitis. If it doesn't get any better or actually gets worse, it's most likely not epididymitis.