Yes, you'll definitely have enough time. Take the City Air Train (CAT) into Wien Mitte (Vienna Central) train station and then transfer onto the U3 Subway to Stephansdom-City. The whole journey won't take more than 25 minutes. That will put you right into the very heart of the city where you can walk around the pedestrian zone for a couple of hours and get lost visiting the various cafes, shops, etc in that area. You can then reverse the above train procedure and get back to VIE with time to spare.
PS: If you have money to blow you can avoid the trains and take a cab or any one of the car services in VIE's arrivals hall. C&K is the best, would probably cost you around 25 euros into the city. A cab will be more.