How do I name a selected group via python script
Using Object.users_group returns a list of all groups the object is assigned to. Decide which group of the list you'd like to rename and assign a new name to GroupData.name property.

import bpy

obj = bpy.context.object
obj_group = next(iter(obj.users_group), None)

if obj_group:
    grp = bpy.data.groups.get(obj_group.name)
    grp.name += "_special"