how to make custom link in wordpress

I am assuming the \ are not part of your code, but if they are then those need to be removed. You also are trying to use $user_id without ever declaring it.

Here is how I would write the function:

function cgc_ub_action_links( $actions, $user_object ) {

    $url = add_query_arg( array(
        'page_id'    => 13,
        'um_user'    => $user_object->ID,
        'profiletab' => 'main',
        'um_action'  => 'edit',
    ), site_url() );

    $actions['edit_badges'] = "<a class="cgc_ub_edit_badges" href="" . esc_url( $url ) . "">" . __( 'Edit MySpace', 'cgc_ub' ) . "</a>";

    return $actions;
}
add_filter( 'user_row_actions', 'cgc_ub_action_links', 10, 2 );

I have fixed the misuse of using $user_id and replaced it with the passed in user ID by using $user_object->ID. Since you are trying to link to a front-end page and not an admin page then it makes more sense to just add the query args to the main site URL.

I hope this helps!