How do I display the commentor’s first name and last name in the comments?

This will get you a first name + last name combination if available, or just the first name or last name if that’s all your user submitted.

This assumes you’re interested in registered user’s names. If you’re going to add first and last names to your commenting form… or treat first + last name as “display name” from the back end forward (so possibly not just in commenting forms), either would be something different!

For theme functions.php or plug-in:

add_filter( 'get_comment_author', 'wpse_use_user_real_name', 10, 3 ) ;

//use registered commenter first and/or last names if available
function wpse_use_user_real_name( $author, $comment_id, $comment ) {

    $firstname="" ;
    $lastname="" ;

    //returns 0 for unregistered commenters
    $user_id = $comment->user_id ;

    if ( $user_id ) {

        $user_object = get_userdata( $user_id ) ;

        $firstname = $user_object->user_firstname ;

        $lastname = $user_object->user_lastname ; 

    }

    if ( $firstname || $lastname ) {

        $author = $firstname . ' ' . $lastname ; 

        //remove blank space if one of two names is missing
        $author = trim( $author ) ;

    }

    return $author ;

}

Your results may of course vary depending on your installation and whatever particular requirements you may have added 1) for commenting (i.e., “anyone” vs “registered only”) and 2) for signing up (are First and Last Name required to register?).

Additionally, in a full installation, you might want to adjust the user profile page, where the user selects a “display name.” If you’re going to display firstname/lastname instead then it’d be best to deal with that one way or another – by restricting choices, for example, or by adjusting labels and instructions.