This page contains information regarding Star Trek: Lower Decks, and thus may contain spoilers.
During her time in Starfleet, her specialty was in antimatter. Opinionated and vocal, she also had a tendency to speak quickly when excited.
In 2365, she had recently graduated from Starfleet Academy and was transferred from Starbase 173 to the USS Enterprise-D to serve as an ensign under Lieutenant Geordi La Forge, who requested her after reading her graduating thesis. Brandishing a cup of hot chocolate, Gomez babbled on and on about her assignment, as it had been her goal to serve on the Enterprise-D for years, with her second choice being Ranuos VI. La Forge expressed appreciation for her excitement, and mentioned that she could be of better service if she learned to relax a little. She apologized when he noted that she had brought the beverage into engineering where it might spill on the equipment and damage it, saying that she had forgotten she was holding it. In her eagerness to get rid of it, she accidentally spilled it on Captain Picard instead. Embarrassed, she offered to clean him up, but he told her it would be easier for him to change his uniform instead.
Later, La Forge took her to Ten Forward to unwind. There, she explained that she had wanted to be among the first to see the new discoveries out in space. La Forge then cautioned her to slow down, saying she "won't last long banging into walls". He also promised to let her know about any exciting things which came their way.
While trying to reactivate the Enterprise-D's shields, Gomez was having trouble concentrating on her work, thinking of the eighteen crew members who had died due to a Borg attack. La Forge helped her to focus on what needed to be done, assuring her she could grieve later. (TNG: "Q Who")
Later that year, she and La Forge reassured Wesley Crusher as the would-be Starfleet Academy cadet left to take his exams. When Crusher clarified that he was worried about having nothing to discuss with Captain Picard during the 6 hour shuttle flight to Starbase 515, she suggested archaeology, semantics, literature, or art as possible topics of conversation, adding that Wesley could learn a lot from the captain.
Gomez eventually transferred to the command division, and by 2381, she rose to the rank of captain, and was given command of the Obena-class USS Archimedes. By this time, she was considered old friends with Captain Carol Freeman of the USS Cerritos.
On the Archimedes, Gomez's approach to first contact missions was shrewd, such as asking the helm to slow the vessel and the assisting Cerritos to stay out of the star system to avoid intimidating the Lapeerians in the first contact with them. (LD: "First First Contact")
As captain, she encouraged junior officers when they made mistakes, and in a crisis, was quick to lead the crew away from distress to problem-solving. She was also not adverse to falling back on her engineering background and tackling problems by getting her hands dirty when appropriate. (LD: "First First Contact")
Gomez was played by actress Lycia Naff. The script for "Q Who" describes Gomez as "a young twenty five to twenty eight year old ensign – who has newly arrived on the Enterprise. She is very energetic, and enthusiastic in an open and ingenuous way, which is both appealing and refreshing." 
In a 2012 interview with Naff, it was noted that her character was initially supposed to be recurring with the intention of becoming a love interest for La Forge, but she was dropped after her second appearance.
According to Naff, "I was supposed to be there for three episodes, because they were trying to find a reason [Geordi] would take his visor off, to justify a reason he would undergo a dangerous surgery to risk his life so he could see again, and the reason was supposed to be because he's in love. They wanted to have us fall in love so deeply that in the next season, he would say, "I have to do this so I can see my beauty." But they also wrote Sonya Gomez as comic relief, as a bumbling ensign with bright eyes who wants to save the world but ends up spilling hot chocolate on Picard, and the feedback they got was that there was no way Geordi would fall in love with someone like me. And I didn't know what they were going for, because we weren't told to play it like it was romantic. I didn't get that clue until later. So we did it more like a little sister/big brother relationship." 
Regarding her proposed third appearance, Naff said, "We also had a major hair crisis. I did two episodes, and I was supposed to come back and do a third, but I wanted to cut my hair. My agent asked if it would be okay, and since I wasn't under contract, they said, "Okay, we're releasing her." So I cut it shaggy, but above the shoulder. I get a call the next week, and they want to redo a hallway scene, and I go back, and they lose their tiny little minds. They were so angry. Everyone was grumbling at me, and making me feel not so great, but LeVar [Burton] was so sweet. He said, "Don't worry. This gives us a chance to do the scene even better." He was so supportive and encouraging, and the scene did come out better. So if you look really closely, you can see the hair extensions." 
Gomez was brought back for an appearance in Star Trek: Lower Decks. Showrunner Mike McMahan said in an interview that he wanted to bring back characters from previous series that the audience might not expect. McMahan said, "In fact, I'm not even sure of the last time Lycia Naff performed a fictional character. It was like, if anybody's going to do it, she's one of the original lower deckers. Let's make her a captain. Let's give her a win. In this episode, I tried to write her as an amazing captain. Where does she end up? What is her attitude? How does she treat her subordinates? Because we see her having a tough time on the Enterprise. And a real theme of this show is where do these characters end up in the end." 
In Pocket Books' Star Trek: Starfleet Corps of Engineers series, Gomez appears (in the post-Dominion War era) as the executive officer of the series ship, USS da Vinci, with the rank of commander. The series also establishes that her middle name is "Guadalupe" and she was born circa 2343 to José Esteban and Guadalupe Gomez and has an older sister, Belinda. During her time on the Enterprise, Gomez struck up friendships with several fellow officers, in particular Kieran Duffy and Wesley Crusher. After the events of "The Hunted", Gomez realized that she had strong feelings for Duffy, and invited him on a date to the arboretum. The two continued a romantic relationship for over a year until 2368, following the events of "Disaster" when Gomez ended their relationship following her promotion to full lieutenant and transfer to the USS Oberth. By 2375, Gomez was promoted to lieutenant commander and became chief engineer of the USS Sentinel. During the Dominion War, the Sentinel was caught behind enemy lines during a mission to sabotage a Dominion outpost when its engines failed. Gomez managed to repair the Sentinel's warp engines, and in order to expedite their retreat, she adjusted the warp fields so that the ship appeared to be a Cardassian freighter to Breen sensors and saved her crew.