Mathematical research groups are, as you seem to have surmised, just groups of faculty members and students (i.e., graduate students, postdocs, tenure track and tenured professors) whose research interests all involve some common subfield of mathematics. Thus a number theory group will be composed of number theorists and perhaps faculty members whose main interest is in some other area of math (e.g., combinatorics) but involves number theory in a substantial way. Continuing with the example of a number theory group, at some schools all of the members of the group will be involved in the same flavor of number theory (e.g., the group might be biased towards arithmetic geometry), while at other schools the group might have people representing many different area of number theory (algebraic, analytic, arithmetic geometry, etc).
So what is the purposes of these groups? Well, they're just as much for the faculty members as they are for students. As you mentioned in your post, students in a research group are likely to hang out and talk math with one another. (You'll also be taking a lot of topics classes with the other students in your research group.) The same goes for faculty members. If you're a professor working on a project it's very nice to have someone who works down the hall from you that you can ask fairly technical questions to. (Or perhaps "stupid" questions whose answer you don't know but feel you should.)
Research groups will also generally have their own weekly seminars. Sometimes these seminars have a lot of talks by the faculty and students at that school, while other times the speakers are primarily visitors from other schools. This gives graduate students the opportunity to see what sort of problems people are working on at the moment and a bit of perspective about the nature of their research area that goes beyond the particular problems that the local professors are studying.