1) Open libraries\joomla\database\table\user.php file.
Find:
function __construct( &$db )
Replace:
function __construct( &$db )
var $extra1 = null;
var $extra2 = null;
2) Now add this fields in database using below SQL query.
ALTER TABLE jos_users ADD extra1 varchar(255);
ALTER TABLE jos_users ADD extra2 varchar(255);
3) Open administrator\components\com_users\views\user\tmpl\form.php. Add below code for two fields in registration page.
<tr>
    <td width=”150″>
<label for=”extra1″>
    <?php echo JText::_( ‘extra1’ ); ?>
</label>
</td>
<td>
    <input type=”text” name=”extra1″ id=”extra1″ class=”inputbox” size=”40″ value=”<?php echo $this->user->get(‘extra1’); ?>” />
</td>
</tr>
<tr>
<td width=”150″>
<label for=”extra2″>
    <?php echo JText::_( ‘extra2’ ); ?>
</label>
</td>
<td>
    <input type=”text” name=”extra2″ id=”extra2″ class=”inputbox” size=”40″ value=”<?php echo $this->user->get(‘extra2’); ?>” />
</td>
</tr>
4) Open components\com_user\views\register\tmpl\default.php , Add below code where you want to show extra fields.
<tr>
  <td height=”40″>
      <label id=”extra1msg” for=”extra1″>
         <?php echo JText::_( ‘extra1’ ); ?>:
      </label>
</td>
   <td>
       <input type=”text” name=”extra1″ id=”extra1″ size=”40″ value=”<?php echo $this->escape($this->user->get( ‘extra1’ ));?>” maxlength=”50″ /> *
   </td>
</tr>
<tr>
   <td height=”40″>
      <label id=”extra2msg” for=”extra2″>
         <?php echo JText::_( ‘extra2’ ); ?>:
      </label>
  </td>
  <td>
       <input type=”text” name=”extra2″ id=”extra2″ size=”40″ value=”<?php echo $this->escape($this->user->get( ‘extra2’ ));?>” maxlength=”50″ /> *
   </td>
</tr>
5) Copy all files from components\com_user\views\register\tmpl folder and paste it to your custom theme template(default is “rukhmilkway”) directory. ( templates\{custom_theme}\html\com_user\register )
6) For edit profile of user, Copy all files from components\com_user\views\user\tmpl directory and paste it to  templates\{custom_theme}\html\com_user\user. Now open form.php file and add below code for two extra fields.
<tr>
    <td width=”120″>
        <label for=”extra1″>
            <?php echo JText::_( ‘extra1’ ); ?>:
        </label>
    </td>
    <td>
        <input type=”text” id=”extra1″ name=”extra1″ value=”<?php echo $this->escape($this->user->get(‘extra1’));?>” size=”40″ />
    </td>
</tr>
<tr>
    <td width=”120″>
        <label for=”extra2″>
            <?php echo JText::_( ‘extra2’ ); ?>:
        </label>
    </td>
    <td>
        <input type=”text” id=”extra2″ name=”extra2″ value=”<?php echo $this->escape($this->user->get(‘extra2’));?>” size=”40″ />
    </td>
</tr>