In most cases, groups of three to four students tend to work best. Although working in pairs may guarantee that each student is involved, they tend to lack for diversity of ideas and will fall apart if one member drops out or gets sick. On the other hand, groups larger than four tend to be unwieldy and make it easier for timid students to sit back and let others participate.
Ideally, each group will have some stronger and some weaker students so that the groups are fairly evenly matched according to range of life experience, understanding of topic, and balance of work/study time. In mixed teams, weaker students benefit by seeing how more experienced students go about solving problems, and stronger students reinforce their knowledge by teaching someone else. Homogeneous groups don't get this benefit, and they also tend to divide the work among themselves with no interaction.
Also consider different aspects of diversity. If you only have two female students, for example, don't initially separate them in an attempt to create multiple diverse teams. They may learn better together at the beginning of the class and later integrate into other teams.
Pay attention to how you give directions for group work. Practice giving concise instructions out loud the first time you try a new activity. Or try them out on a friend or fellow teacher to see if they are clear.
As the groups work, move around the room to facilitate and make sure that each person has a role or a way to contribute.