tl;dr: Cersei's position as regent ended when Joffrey turned 16, but exactly when that happened in the show isn't clear. It certainly had nothing to do with Joffrey getting married.
In the novels, Cersei is still Queen Regent at this point in the story. Joffrey won't be considered an adult until he is 16, and in the novels he's only 14 when he gets married
and dies, at which point she is Tommen's regent.
In the show, the question is a lot more complex. Most of the underage characters in the show are several years older than their book counterparts (largely because of Danaerys being only 12 when she marries Drogo and gets pregnant). Thus, by this point in the show, Joffrey should already be 16, which means, he shouldn't have a regent, he is King in his own right. I'm not exactly sure of the time scales in the show, but it possible that Cersei had no right to name herself regent in the first place.
Out of universe, I'd have to chalk this up to a continuity goof on the writer's part, stemming from their age advancement of Joffrey. In universe, there's no real explanation for Cersei's title, or why Oberyn thinks she "lost" it, in any official capacity.
However, I can make a guess, based on the political maneuvering at King's Landing, that something like this is happening:
- Cersei desperately wants to be Queen, so when her husband dies, she takes the opportunity to name herself regent for Joffrey, deserved or otherwise. Given her connections both inside and outside King's Landing, no one argues with her.
- Joffrey's behavior clearly indicates that he's not mentally mature enough to be King, regardless of his physical age, so when Cersei, and later Tywin, act on his behalf as Queen Regent and Hand to undo some of Joffrey's screw ups, people just listen to them.
- Now, however, there is another powerful woman in Joffrey's life -- Margaery -- whom he is starting to listen to more than his mother. This diminishes Cersei's control over Joffrey, which was probably never official to begin with.
- As soon as Margaery marries Joffrey, she becomes Queen, and gains some official authority. This, plus Joffrey's obvious support for her, basically pushes Cersei into the background.
- Oberyn was basically making a dig at Cersei, letter her know that he understands the dynamics going on in the King's court, and how much power she is losing there.