This doc provides setup instructions for the WooCommerce extension.
Assign a role to a user upon purchase of a specific product
The extension allows you to assign a role to a user upon purchase of a specific WooCommerce product. To do this all you need to to is go to the WooCommerce edit product page and go to the right hand side of the page and find the Ultimate Member widget (see below). All you need to do is select the role from the dropdown and then update the product page.