Two characters named Gothmog are mentioned in
Tolkien's writings. One is the Balrog of the Silmarillion, kept
from the earlier version found in Book of Lost Tales. The other
is probably named for the Balrog and is the Lieutenant of Minas Morgul
in the Third Age, spoken of in the Return of the King.
In BoLT, Gothmog was the son of Melko (Melkor/Morgoth). In later versions, none of the Valar had children, so this concept was dropped. But in BoLT, this gave him special status as all of those people opposed to the Valar of Valinor were under Melkor. His mother was called Ulbandi, in one spot, and the ogress Fluithin in another. Gothmog was also called Kosomot. As the book goes on, we find that Kosomot is Gothmog, Lord of the Balrogs. In BoLT's name list for the Fall of Gondolin, Gothmog means "Strife-and-hatred" with mog as "detest/hate" in the Gnomish (Noldorin) dictionary, and he's called "Captain of Balrogs". A later name list in the 1930's shows goth as meaning "Lord" or "Master". In Eldarissa (Eldar language distinct from Noldorissa), Gothmog is known as Kosmoko and Kosomok(o)
In BoLT2, he is prominent in "The Fall of Gondolin". It speaks of him as "lord of balrogs, captain of the hosts of Melko". In another, BoLT1's "The Coming of the Valar", he is called a "marshall " of the hosts of Melko.
At the Fall of Gondolin, Gothmog had the metal dragons (robots) of Morgoth pile themselves at the northern gate of Gondolin and knock it down. The top metal beasts "opened about their middles, and an innumerable host of the Orcs, the goblins of hatred, poured therefrom into the breach...". (In later stories, dragons are organic, not metal.) Later, when the elf, Rog, and his people called "The Hammer of Wrath", attacked and killed balrogs, Gothmog stepped in again. He had a group of his demons attack from the front, then fall back to lure them between two much larger flanking forces. The elves were supposed to try to pull back, but instead attacked more fiercely forcing onward and destroying those who lured them, then killed many bands of the besiegers, until they were at last overpowered by numbers of Orcs and Balrogs and by a firedrake. The loss of Rog's force hurt the morale of the elves, gave Melko's forces the gate, much of the walls, and a good part down to the center of the city. A firedrake and Gothmog together beat down Tuor who had saved Ecthelion, so Ecthelion rose up and attacked Gothmog, driving the spike of his helmet into Gothmog's chest and toppled him over into the king's fountain so that they fell together and their weight took them deep and drowned them.
The "Fall of Gondolin" story changed much between the time of the BoLT and the Silmarillion.
As the stories developed, Gothmog, no longer the son of Melkor, became the slayer of Feanor. Then in the Battle of Unnumbered Tears it was Gothmog who slew Fingon and captured Hurin.
In the Return of the the King, in the Third Age of the Sun, Gothmog was the name of the lieutenant of Minas Morgul.