How long can an aneurysm be there before it ruptures?

Depends on size. See cdc. Gov AAA fact sheet. Make sure you keep up with your follow up to make sure your AAA is not enlarging.
Many years. The likelihood that an abdominal aortic aneurysm will rupture is mostly related to how large it is. Most aneurysms develop very slowly over a number of years. Once it hits a critical size however, the risk of rupture outweigh the risks or surgery and therefore surgical repair should be performed.