As soon as the merchant restocks, anything you've sold them disappears.
At this point, PC players who want to "buy" it back can simulate this with the console with two commands. You'll first have to find the internal item ID of the mask and its gold value, which you can look up at Skyrim Artifacts (beware spoilers!) in the "ID" and "coin" columns.
Armed with these two numbers (save first! always make a new save first), open the console (~ on US keyboards) and type:
additem ItemIDGoesHere 1
removeitem 0000000f MaskValueGoesHere
The first line adds 1 of whatever item ID you give it in
ItemIDGoesHere, which should be the ID of the mask you want to "buy" back. The second line removes a number of gold equal to
MaskvalueGoesHere (gold is item ID
0000000f). Make sure you have enough gold to remove before you go removing it! (Probably it would just reduce your gold carried to 0 instead of anything bad, but why tempt fate?)
For example, to get Volsung back, you would type:
additem 00061cab 1
removeitem 0000000f 4611
If you want to be super-correct about this, you can try to calculate your current vendor buying percentage and adjust the value upward. Or, if you don't want to "buy" it and just want it back, you can entirely skip the command that removes the gold from your inventory. It's a single-player game, so whatever feels appropriate to you, do that.