YITH WooCommerce Subscription allows generating recurring payments for your products. Let your customers join a subscription plan with a payment cycle of your choice and many other options.
If you combine this plugin with YITH WooCommerce Subscription, the customer will automatically get the role you have set when the subscription changes to status ‘active’ or ‘trial’. The role will be removed automatically when the subscription gets the status ‘paused’, ‘pending’, ‘overdue’, ‘cancelled’, ‘expired’ or ‘suspended’.
You will only have to activate both plugins in order to make them work together. For more information on how to create a subscription, check the full documentation here.