We've just returned from a 10 day trip (5 days in Vienna and 5 in Budapest), so I advise you the following:
stay 6 nights in Vienna (and if you get "bored", although I doubt it, go to Bratislava for 1 day, since is 1 hour by train away from Vienna) and stay 4 nights in Budapest.
Vienna is more offering from all points of view (music, museums, sights, parks, shopping, food, cafes etc). Don't miss the Schonbrunn, Hofburg palaces, Albertina museum, Belvedere palace, all the famous churches in the city, all history museums, the opera, the parlament or just wander around the inner stadt and prepare to be amazed by the great architecture!
Enjoy!