Your first thought Could these be menstrual cramps? is similar to what many other young women would wonder. As you said, its unlikely because of where the pain is.
Since this is new pain for you, you need to call your doctor for advice.
Meanwhile, here is how I approach this symptom.
Doctors call this area of the body the right upper quadrant of the abdomen. The two organs that make up most of the right upper quadrant are the liver and the gallbladder.
Gallstones could cause on and off sharp pains in the right upper quadrant. Gallstones can form in the gallbladder and pass into the bile duct. If they temporarily get stuck, you might feel the kind of pain youre describing. These pains, called biliary colic, classically come on after eating, especially fatty food. Often nausea, too.
If your liver was swollen or inflamed, it could be painful. But the pain is usually dull and persistent. So liver is probably not the issue.
Part of the lower intestine also passes through the right upper quadrant. So constipation and gas could cause crampy pain.
The pain could also be from muscle cramps. Its a bit unusual to have abdominal muscle cramps in this area of the body, but it is something to think about.
Sometimes abdominal pain that is hard to diagnose turns out to be an irritated nerve. Nerves exit from all along our spine to different parts of the body. If the nerve that goes to the right upper quadrant is pinched as it leaves the spine, this could cause sharp pain that comes and goes. Most often, people will describe a burning or tingling pain. And that it starts in the back and wraps around to the front.
These are the most common reasons for pain in the right upper quadrant. But there is a long list of other possibilities.