About 2 months ago i published a post on how to get the number of nodes of a specific taxonomy term by term ID.
Drupal – Get number of nodes of Taxonomy Term by Term ID
Unfortunately, the taxonomy_term_count_nodes() no longer works in Drupal 7 but you can get the count by Views in D7.
1. Create a term view (A vocabulary called XXX is used in this example)
2. Add a new relationship Taxonomy term: Content using XXX
3. Turn on the Use aggregation under OTHER settings
4. Add Content: Nid as new field and set the Aggregation type to Count
Reference: Rework Term Node Count for D7