How to add addition attribute and fields in public registration form in Craft CMS
Before you can allow any type of user groups you will need at a minimum of the Client version of Craft. To allow public registration, you will need the Professional version. Only the Professional version will allow you to have public registration on our site. Here is more information about users and user groups.

To add additional fields to your registration form, I would start here. That will get you started with a basic form.

You will need to create a new field within the CP. For example - let's say I want to capture your pets name.

I will create a text input, called petName. Then in the layout builder, I will assign that field to the user profile tab.

Next, I need to update my registration form with my new input. 

Note: any new field you want to add to the user's profile must be prefixed with fields[]. For example:

&lt;label for="petName"&gt;Pet Name&lt;/label&gt;
&lt;input type="text" id="petName" name="fields[petName]" {%- if account is defined %} value="{{ account.petName }}"{% endif %}" placeholder=""&gt;
{{ account is defined and account ? errorList(account.getErrors('petName')) }}


Hope this helps!