How long can you store sugar syrup?
From my experience, sugar syrups don't last too long (a month tops in the refrigerator). You may be able to prolong their shelf life by adding something acidic, or anti-microbial (I think some spices may work) but not by much. As for jams, I don't think it's the sugar that preserves them so much as the acidity or heat from canning/preserving. 

Sucrose is actually something I've used in a laboratory to culture microbes. Many, including a lot of ones we're familiar with contributing to rotting foods in our kitchen, can use sucrose as an energy source. 

That being said, if it passes the smell test, doesn't look cloudy (more than it initially was) it's worth trying a little if you're a home cook. I'd say the cloudiness is the best indicator, especially if it looks like there are strands/strings of cloudiness in the liquid.