How to add custom field to the user profile according to its role in Drupal 7? i need to add some custom fields to the user. These fields are not the same for every user, but they vary according to their roles. How can i do that?

I saw that you can add some custom fields in the configuration menu but those cannot be differentiated according to the role.
User role field module allows you to specify role-specific fields. 
When creating a new field, you specify what roles this field is enabled for.

Fields are only visible and editable if a user has a specific role.

This role does not determine access controls for visible fields. 
You could use the Field Permissions module for setting access controls. 

More then 120 sites currently use this module.