How do I assign a role to a user after the user's email is confirmed? I want to assign a role to a user after the user confirms his/her email.

How do I do this?
You'll want to take a look at Rules and LoginToboggan (as per this answer on Drupal Answers).

Rules will allow you to add a "trigger", such as adding a role to a user, and LoginToboggan will provide the "trigger" for when the account is validated.