restrict category to only logged in User

Inside while loop of single.php you can put condition like this

if(in_category('Catetory_slug')){ //Specifying category whom we don't want to see by no logged in users
    if(is_user_logged_in()){      //Checking if user logged in or not
        //code inside single.php
    }else{
        Echo "You need to login to view this post."; //message for no logged in users
}}

This can be done for other template of theme files like we did for single.php.

UPDATE

If you want one user couldn’t see posts of another user then you can use these two functions to achieve this

Use following inside while loop

//storing autor's display name in variable
$post_author = get_the_author();    
$current_user = wp_get_current_user();
//storing autor's display name in variable
$current_user_info = $current_user->display_name;
//Chacking if bot strings (display names) are equal or not
if (strcmp($post_author, $current_user_info) == 0) {  

     //Your Code to display post's content

}

You can also put if condition on ID instead of display name. For that you need to make 2 changes in above code

  1. replace get_the_author() function with get_the_author_meta()
  2. and replace following line of code

    $current_user_info = $current_user->display_name;

with this

$current_user_info = $current_user->ID; 

To know more read about this functions in detail in my given link.