how to print total number of posts filtered by category?

I think this will do

foreach((get_the_terms($post->ID, 'project_category')) as $term) { 
   echo $term->term_id, " -> ", $term->count,  '<br>';
   // if post assigned to more than once category you will have multiple lines 
}

Basically get_the_terms call already returns term object, so you can access all properties, including count