You'll need to extend your (child-) themes functions.php with the following:
function so_loginout_menu_links( $items, $args ) {
if ( $args->theme_location == 'primary' && function_exists('is_woocommerce') ) {
if (is_user_logged_in()) {
$items .= '<li><a href="'. wp_logout_url() .'">'. __("Log Out") .'</a></li>';
$items .= '<li><a href="'. get_permalink( get_option('woocommerce_myaccount_page_id') ).'">'. __("My Account") .'</a></li>';
} else {
$items .= '<li><a href="'. wp_registration_url() .'">'. __("Log In") .'</a></li>';
$items .= '<li><a href="'. site_url('/wp-login.php?action=register').'">'. __("Register") .'</a></li>';
}
}
return $items;
}
add_filter( 'wp_nav_menu_items', 'so_loginout_menu_links', 10, 2 );
This extends the menu "primary" with two links by filtering it, dependant on whether the user is logged in or not. I've added a check for woocommerce as well, as the account page is woocommerce specific and might throw errors in case it's deactivated.
"primary" in the code above might need to be replaced with "primary-menu", "top" or whatever your themes primary navigation menu is called.
Also make sure that Administration > Settings > General > Membership "Anyone can register" is checked, otherwise the link may not be shown.
Note there's no additional CSS in my example now, so the additional items will not yet be in a dropdown or anything. To get that, inspect your existing menu items and add the according classes and additional top level items into the code above accordingly.