I think that it depends on the activity or assignment you are covering, when it comes to forming or assigning student teams. For certain activities that are geared more toward being fun for the students, I think that allowing them to pick their own groups or simply numbering off by rows to form the groups would work. Although, when the assignment is more difficult or time consuming for the students, pre-forming the groups that you see best fit would be more appropriate. So, by mixing gender, race, and ability levels to get a good mix for students to work in groups, ie heterogeneous grouping.
Fun Grouping Options (Physical Education):