We can imagine having 3 pools ("A", "B", "C") of different students (each with $n$ students in total), and we want to fill $n$ 3-people slots with students of the 3 distinct types. Since the order within a set does not matter, we can imagine that "A" students are only assigned to the first slot, "B" students only to the second, and "C" students only to the third.
The "first" set (3-people slot) that is formed has $n^3$ possible combinations of students: $n$ choices for the first slot, $n$ for the second and $n$ for the third. After this first 3-people slot is filled, each pool A,B,C has $n-1$ students left. Hence for the "second" set (3-people slot), there are only $(n-1)^3$ possibilities to assign students, and so on. Once there is just one student left in each pool, there is just one possibility to form a group.
This leads to a total number of $\sum_{i=0}^{n-1} (n-i)^3$ sets that can be formed (note that the labeling of the sets does not matter - that's why I put first and second in quotation marks).