It's fully up to the GM.
The PHB (pg 174) states,
The DM calls for an ability check when a character or monster attempts an action (other than an attack) that has a chance of failure [or success].
The system gives significant leeway to DMs when calling for checks like this--the DM can decide whether the NPC failed in a way that allows the PC to react, or if the PC only wakes up to find the NPC fleeing. Maybe the NPC made a noise as it removed the sword from the sheath, or it made a noise as it tried to escape with the sword. Maybe the NPC managed to drop the sword onto the PC, and the PC takes damage!
As you can see, there are a number of ways for the NPC to fail, and some of them allow the PC to try to snatch the sword back (using DEX or otherwise), and some of them don't. While the system does define certain areas for ability checks, it leaves many situations like these open.
It would probably not be a saving throw
PHB 179 defines a saving throw as:
A saving throw—also called a save—represents an attempt to resist a spell, a trap, a poison, a disease, or a similar threat. You don’t normally decide to make a saving throw; you are forced to make one because your character or monster is at risk of harm.
A saving throw is fundamentally reactive, whereas an ability check is active. Because snatching the sword back is an action that the PC actively initiates, the play would probably roll an ability check instead of a saving throw. Of course, perception is a major exception to this general rule, but it would only apply to the PC noticing the NPC, and not to any action the PC might take in response.