You must cast the spell as Ogre Battlecaster's triggered ability resolves. You can't wait and cast it later.

Artwork
Loading artwork…
Ogre Battlecaster
Jumpstart 2022 · #36 · EN
Nonfoil—Foil—
Card rules
First strike
Whenever this creature attacks, you may cast target instant or sorcery card from your graveyard by paying 
in addition to its other costs. If that spell would be put into a graveyard, exile it instead. When you cast that spell, this creature gets +X/+0 until end of turn, where X is that spell's mana value.
3/3
Rare · Illustrated by Javier Charro
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions