How long do tree stumps take to decay?
There are too many factors here to give any sort of objective answer:


Local climate
Tree species
Tree health
Location conditions
Future weather, insects, etc.


Ultimately it comes down to your tolerance for risk. A stump of that diameter will remain structurally sound at its core for a number of years, within reason. I'd consider it robust enough to support a modest structure (say 4x6 feet, weighing at most a few hundred lbs.) for at least four. However, the outer edges will begin to decay first. I wouldn't rely on lag screws, for example, for load bearing. I'd be cutting notches into the top of the stump to carry beams, and relying on mechanical fasteners only for stability. 

Check it every year for signs of instability. It'll be fairly apparent when it starts to get sketchy.