Hi there! The best time to visit Vienna is from April to May or September to October. Most people visiting Vienna look to enjoy the warm sunny weather of Vienna. June and August is the seasonal time in Vienna and so, prices skyrocket and the city might become too crowded to enjoy.
Winters are extremely brutal in Austria. We visited in August this year, when it was supposedly summer, but frankly the morning air was still nippy. The best time to go would be April - September. Also, don't just plan Vienna. If you're going that far, Salzburg, Innsbruck, Hallstat and the whole Austrian Alps side is worth exploring.