Update a user field with a generated text

Your hook already gives you user id, you don’t need to $current_user.

add_action ('user_register', 'mailboxNumberGenerator', 10, 1);

function mailboxNumberGenerator($user_id)
{    
    $initialMailboxNum = 100000;

    $user_query = new WP_User_Query( array( 'role' => 'Customer' ) );
    $user_query2 = new WP_User_Query( array( 'role' => 'Subscriber' ) );
    $currentMailboxNum = $initialMailboxNum 
    + $user_query->get_total() + $user_query2->get_total();

    $newMailboxNum = $currentMailboxNum + 1;

    update_user_meta ($user_id, 'nickname', $newMailboxNum);
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)