need to get user ID after a user logs in

wp_login is passed two params, but you will need to update your hook to pass them correctly to your function:

function test_mail( $user_login, $user ) {
    //$user = wp_get_current_user();
    $message .= "CURRENT USER ID: " . $user->ID . "\n";
        
    $to = "[email protected]";
    $subject = "Testing mail from login";
    $header = "";
    $attachments  = "";
    wp_mail( $to, $subject, $message, $headers, $attachments );      
}
add_action('wp_login', 'test_mail', 10, 2);

Read more here: https://developer.wordpress.org/reference/hooks/wp_login/