How to get a count of groups that user has joined?
To get Count of all groups....

$groups = og_get_all_group($group_type = 'node');
$count = count($groups);


To get User Groups Count

$user_groups = og_get_groups_by_user();
$user_count = count($user_groups);