You can cast the instant or sorcery during the End step after you put the “at the beginning of the end step” trigger on the stack, as long as you do so before that trigger resolves.

Artwork
Loading artwork…
Psychic Theft
Prophecy · #40 · EN
Nonfoil—Foil—
Card rules
Target player reveals their hand. You choose an instant or sorcery card from it and exile that card. You may cast that card for as long as it remains exiled. At the beginning of the next end step, if you haven't cast the card, return it to its owner's hand.
Rare · Illustrated by Don Hazeltine
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
PreDH Legal
Premodern 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
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
The card may only be cast once. Once it is announced and put on the stack, the card is no longer exiled and the effect of Psychic Theft ends.
The card is revealed to all players while it is exiled.
If you target yourself with this spell, you must reveal your entire hand to the other players just as any other player would.