Oracle Text

Tarmogoyf's power is equal to the number of card types among cards in all graveyards and its toughness is equal to that number plus 1.

Card Rulings

3/14/2017 Tarmogoyf’s ability works in all zones, not just while Tarmogoyf is on the battlefield.
3/14/2017 Tarmogoyf counts card types, not cards. If the only card in all graveyards is a single artifact creature, Tarmogoyf will be 2/3. If the only cards in all graveyards are ten artifact creatures, Tarmogoyf will still be 2/3.
3/14/2017 The card types that can appear on cards in a graveyard are artifact, creature, enchantment, instant, land, planeswalker, sorcery, and tribal (a card type that appears on some older cards). Legendary and basic are supertypes, not card types.