As Thought Gorger's first ability resolves, putting a +1/+1 counter on it for each card in your hand is mandatory. The effect says "if you do" because performing that action might be impossible. If Thought Gorger has left the battlefield by the time the ability resolves, you can't put any +1/+1 counters on it, so you won't discard your hand.

Artwork
Loading artwork…
Thought Gorger
Rise of the Eldrazi · #129 · EN
Nonfoil—Foil—
Card rules
Trample
When this creature enters, put a +1/+1 counter on it for each card in your hand. If you do, discard your hand.
When this creature leaves the battlefield, draw a card for each +1/+1 counter on it.
2/2
Rare · Illustrated by Jason Felix
Format legality
Commander Legal
Duel Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
PreDH Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Pioneer Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
Once an ability starts to resolve, it's too late to respond to it. For example, you can't count a card in your hand while determining how many +1/+1 counters Thought Gorger gets and then cast it in response. If a card is counted, it'll be discarded.
When Thought Gorger's second ability resolves, its last existence on the battlefield is checked to see how many +1/+1 counters it had on it. All of them are counted, not just the ones put on it by its "enters" ability.