How to use the Rules module to attribute a new user role after a product was bought?
Refer to the tutorial Selling Content with Drupal Commerce using Content Access and Roles for granting access to premium content to users who have a "premium" role.

Here is a summary of the steps required (= quote from that link):


Enable Content Access and the ACL (optional) module.
Create a role called "premium".
Create a content type called "Premium Content" and put some great content in it.
Verify that users can only access the premium content if they have the premium role.
Create a product representing the premium role.
Create a rule that grants the premium role on order completion:


After updating an order.
If the order state is Completed.
And the order contains our premium product.
Add a role to the user who is the owner of the order.