How do i get user data from a custom table in the wordpress database by user ID?

The first section of your code is correct

  global $wpdb;

  $table_name = $wpdb->prefix . "wplusersprofiles";

  $user = $wpdb->get_results( "SELECT * FROM $table_name" );

The problem is in the way you tried to fetch the individual row data. The get_results function in your case returns an object array. So the correct way to fetch individual data should be like…

<?php foreach ($user as $row){ ?>
<tr>
    <th><label for="gender"><?php _e("Gender"); ?></label></th>
    <td>
        <input type="text" name="gender" id="gender" value="<?php echo $row->gender ?>" class="regular-text" /><br />
    </td>
</tr>
<?php } ?>