You can keep unspent green mana indefinitely while Fangorn, Tree Shepherd is on the battlefield. That means if you add a green mana during one step or phase, you can spend it during a later step or phase, or even a later turn. Other types of mana will be lost as normal as each step and phase ends.

Artwork
Loading artwork…
Fangorn, Tree Shepherd
The Lord of the Rings: Tales of Middle-earth · #166 · EN
Nonfoil—Foil—
Card rules
Treefolk you control have vigilance.
Whenever one or more Treefolk you control attack, add twice that much
.
You don't lose unspent green mana as steps and phases end.
4/10
"I am an Ent. Fangorn is my name according to some, Treebeard others make it."
Rare · Illustrated by Jesper Ejsing
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
If a green mana you add has certain restrictions or riders associated with it (for example, if it was produced by Great Hall of the Citadel), they'll apply to that mana no matter when you spend it.
Once Fangorn, Tree Shepherd leaves the battlefield, you have until the end of the current step or phase to spend your unspent green mana before it is lost as normal. There is no penalty associated with this other than the loss of the mana.