Electro's last ability triggers without requiring a target. You choose the value of X as that ability resolves. If you pay the mana, a second "reflexive" ability triggers. You choose the target for that ability at that time. Players can respond to the reflexive triggered ability as normal, knowing the amount of damage that will be dealt as that ability resolves.

Artwork
Loading artwork…
Electro, Assaulting Battery
Marvel's Spider-Man · #76 · EN
Nonfoil—Foil—
Card rules
Flying
You don't lose unspent red mana as steps and phases end.
Whenever you cast an instant or sorcery spell, add
.
When Electro leaves the battlefield, you may pay X. When you do, he deals X damage to target player.
2/3
Rare · Illustrated by Piotr Dura
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
If a red mana you add has certain restrictions or riders associated with it (for example, if it was produced by the last ability of Arena of Glory), they'll apply to that mana no matter when you spend it.
You can keep unspent red mana indefinitely while Electro is under your control. That means if you add a red mana during one step or phase, you can spend it during a later step or phase, or even a later turn. You will still lose other types of unspent mana as each step and phase ends.
Once Electro leaves the battlefield, you have until the end of the current step or phase to spend whatever red mana you have before you lose that mana as normal. There is no penalty associated with this other than the loss of the mana.