How to add and delete a user to another group using the Group module?
Found the solution. When using the group module, there are methods which work well. I used a hook_group_membership_insert($group_membership):

function [my_module]_group_membership_insert($group_membership) {

   $grouptest = group_load($group_membership-&gt;gid);
   $grouptest-&gt;addMember($group_membership-&gt;uid);
}


The same exists for deleting a member, just use the following function: 

$grouptest-&gt;removeMember($uid);