How to add class in dropdown sub-menu in the wp_nav_menu

You can use Walker_Nav_Menu
Here is an example –
In header.php file –

wp_nav_menu( array(
‘theme_location’ => ‘primary’,
‘walker’ => new Dandd_Wrap()
) );

In my functions.php file –

class Dandd_Wrap extends Walker_Nav_Menu
{
    function start_lvl(&$output, $depth = 0, $args = array())
    {
        $indent = str_repeat("\t", $depth);
        $output .= "\n<div class='sub-menu-holder'>$indent<ul class=\"drop-down\">\n";
    }

    function end_lvl(&$output, $depth = 0, $args = array())
    {
        $indent = str_repeat("\t", $depth);
        $output .= "$indent</ul></div>\n";
    }
}