I bring the cider to a boil and simmer the spices for 15 minutes. Immediately after, I pour the cider into canning Mason glass jars with the lids that have the button. How long should I expect the cider to be good for unopened?
Assuming you follow the usual procedere of cleaning and boiling ("sterilizing"1) the jars, filling the hot cider in hot jars and closing immediately, you should be fine for a few weeks. Or not, there is always a slight risk of the jars not sealing properly and your cider not being acidic enough.
Processing the jars as you would for other canning and repeating the processing after a day or two should get you on the super-safe side (including eliminating the very, very slim botulism risk from your spices).
This is probably overkill, even a standard waterbath canning should leave you with a cider that stays good for a year or more.
Just remove the rings after the jars have cooled well, so that any faulty seal becomes obvious right away.