The increment ability resolves before the spell that caused it to trigger. It resolves even if that spell is countered or otherwise leaves the stack.

Artwork
Loading artwork…
Cuboid Colony
Secrets of Strixhaven · #183 · EN
Nonfoil—Foil—
Card rules
Flash
Flying, trample
Increment (Whenever you cast a spell, if the amount of mana you spent is greater than this creature's power or toughness, put a +1/+1 counter on this creature.)
1/1
It's chaotic in the midst of the swarm—only when you step back does the pattern emerge.
Uncommon · Illustrated by Alexandre Honoré
Format legality
Alchemy Legal
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Future Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pioneer Legal
Standard Legal
Standard Brawl Legal
Timeless Legal
Tlr Legal
Vintage Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
PreDH Not Legal
Premodern Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
An increment ability will only trigger if the permanent it's on is a creature. Similarly, if the permanent is no longer a creature when its increment ability resolves, the ability won't do anything.
Whenever you cast a spell, check the amount of mana you spent to cast it against the power and toughness of the creature with increment. If the amount of mana you spent isn't greater than either of that creature's stats, increment won't trigger at all.
If increment triggers, the comparison will happen again when the ability tries to resolve. If the amount of mana spent to cast that spell isn't greater than either of that creature's stats anymore, the ability will do nothing.
When comparing the mana spent to the creature's stats as the increment ability resolves, it's possible that the stat that is less than the mana spent changes from power to toughness or vice versa. For example, say you control a 1/3 creature with increment and you pay two mana to cast a spell. Since the amount of mana you spent is greater than the creature's power, increment will trigger. While the increment ability is on the stack, an effect gives the creature with increment +2/-2, making it a 3/1. When the increment ability resolves, the creature will still get a +1/+1 counter since the amount of mana you spent is greater than that creature's toughness.