You can use get_terms, then term->count..
The below will list all the terms from the Desserts taxonomy with their name and post count.
<?php
$terms = get_terms( 'desserts' );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
echo '<ul>';
foreach ( $terms as $term ) {
echo '<li>' . $term->name . ' - ' . $term->count . '</li>';
}
echo '</ul>';
}
?>
For more info check – HERE