The best person to answer your question would be your primary care physician
. How long a stress test lasts depends entirely on what type of stress test you are planning on having. The shortest of all the stress tests are the simple exercise treadmill test without imaging. This type of test is usually pretty quick. You'll only be on the treadmill for ~15 minutes. You'll have to factor in your cool down time and any other time you'll be waiting for others to finish. A nuclear stress test will take much longer on the order of a few hours because of the imaging before and after that needs to occur.
I suggest that you give your primary care physician or cardiologist a call and ask first what type of stress test you have having. If it is a simple treadmill test, its early in the morning, and you expect it to be normal, then you might be able to allow just an hour. If it is a nuclear stress test or an echocardiogram
stress test, then you might need to leave more time such as 2-5 hours depending on the time of day and whether or not you think it will show a problem. Remember that if a stress test shows a problem, many cardiologists will want to do more testing or perhaps a cardiac catheterization right away. This might mean that you wouldn't be able to get back to work anyway.