Adding custom variable to $user object
To add a field to the user entity, you need to visit the menu entry Administration > Configuration > People > Account Settings > Manage Fields. You can then define the field properties (including specifying whether it appears on the registration form or not) and customize how it is displayed on user pages.