Get Groups from User in plugin
Your code to get a user returns a UserModel (as can be seen from the Full Class Reference docs):

$user = craft()-&gt;users-&gt;getUserById($id);


You can then get the user groups the $user is a member of usinggetGroups()(from the UserModel class):

$user_groups = $user-&gt;getGroups();