Hi,
If the customer purchases several products in the same order, when the order is paid, the user group selected in each product will be added to the user account.
So, you can create several products in an unpublished category, one per user group. Add to them a characteristic with only one value, and then add them to a main product in the "options" area of the main product. Then, when the main product is purchased, the user group of each option product will be added to the user account of the customer.