Sometimes stones can form in the gallbladder. They may simply be there and be of no consequence, but often they temporarily clog the channel, or duct, that bile passes through on the way to the intestine. This causes a crampy pain, usually severe, in the upper right side of the abdomen, just below the ribs, where the liver and gallbladder are located. Many people with this problem go to the ER because the pain is severe. It is most likely to occur after eating, especially if it is a meal high in fat.
The stone usually passes into the intestine eventually, but a person who has stones is likely to have a recurrence. In some cases, a stone stuck in the duct can cause an infection, which can be life-threatening. The treatment for gallstones is to have the gallbladder removed surgically, which is usually done laparoscopically and doesn't require an overnight stay in the hospital. The body adapts to not having the storage sack for bile and instead gets it directly from the liver.
As for when to seek medical attention, if the pain is unremitting, go to the ER for pain control and an evaluation to confirm what the problem is. If it passes, usually because the stone passes, a person can talk to his or her doctor about whether to have the gallbladder removed. In the meantime, avoid fat in the diet to reduce the chance of pain. If the pain is associated with fever, it is a medical emergency and should be treated in the ER ASAP.