A Rogues Gallery is a cast of colorful recurring characters that show up to torment the heroes week after week. Having only a single antagonist can work, but as a series goes on it can become boring. On the other hand, audiences can never get attached to villains if they never come back again. The Rogues Gallery is a middle ground.
Often, one specific member of the Rogues Gallery will be the hero's Arch-Nemesis. For certain special stories, members of the Rogues Gallery may team up against the heroes, forming a Legion of Doom. Sometimes, a one-shot villain will be so popular that they end up joining the ranks of the Rogues Gallery.
Of course, villains can and do appear outside their traditional rogues galleries, fighting heroes they don't usually face. Some even become part of more than one Rogues Gallery. For example, the Marvel Comics villain Kingpin is a major enemy of both Daredevil and SpiderMan. Sometimes, the villain becomes much more identified with the new hero, and they become a Rogues Gallery Transplant.
However large and varied the Rogues Gallery, it will usually contain one villain who is considered to be the hero's Arch-Enemy. There is also a good chance that it will have an evil counterpart of the hero (who may or may not also be the Arch-Enemy.
In order to allow the heroes to sometimes win against the rogues but still leave the villains available for re-use, the prison that they're put in will often be incredibly easy to escape from, or they'll feign having reformed so that they get allowed out, or they'll genuinely seek to reform and get allowed out, only to relent to their old obsessions.
It is also common for a hero's Rogues Gallery to have some kind of unifying theme that either reflects or contrasts with the personality, powers, and/or origin of the hero. For example, most of Spider-Man's enemies gained their powers through scientific mishaps, and many use animal motifs in their names and costumes. Conversely, Batman's array of brightly-colored lunatics falls squarely into the "contrasts with" category with a small smattering of reflect (given Batman's own borderline personality), but its also composed mostly of Trained Supernormals like Batman himself. If all or most of the villains in the Rogues Gallery are linked this way, then you have a Thematic Rogues Gallery.