Space opera isn't an anime specific term, it's an entire sub-genre of science fiction. The easiest way to describe it is in two words: Star Wars. It's the archetypal example of modern space opera.
To be more specific, Wikipedia provides a good description of the genre that lists the key elements:
Space opera is a subgenre of science fiction set mainly or entirely in outer
space, that emphasizes space warfare and melodramatic adventure, and often
risk-taking as well as chivalric romance; usually involving conflict between
opponents possessing advanced abilities, futuristic weapons and other
sophisticated technology.
I'd also add another key element of space opera, an epic scope. They have interstellar scale, taking place on multiple planets, the battles are large and the characters are playing for high stakes.
I've only watched a few episodes of Gundam here and there, and its many series vary a fair bit, but in general I wouldn't call it a good example of space opera. It has many of the elements of space opera, but scope is fairly limited. I don't think any of incarnations of Gundam take place outside of the solar system, and many of them seem to be focused mostly on Earth. I'd say it over all Gundam is better placed in the military sub-genre of science fiction, given the military roles of its main characters, the relatively realistic depictions of warfare and focus on military technology, the titular Gundams.