$query = $db->getQuery(true);
$conditions = array($db->quoteName('user_id'). ' = '. $user_id . ' and group_id = 13');
$query->delete($db->quoteName('#__user_usergroup_map'));
$query->where($conditions);
$db->setQuery($query);
$db->execute();