7 full days? Or you arrive and count that as Day 1? Then which city are you subtracting your travel day from? Counting nights seems to give a better feel for how much time you have. You don’t say where you are coming from (probably helps determine if you have jet lag or not.
I might suggest
Arrive in Budapest, overnight Budapest. Not counting this as a day in the city.
Full day 1-3 Budapest, sleep Budapest
(4 nights Budapest)
Day 4 travel to Prague in the morning, sleep Prague
Full day 5-7 Prague, sleep Prague.
(4 nights Prague)
Day 8 travel home/onward.
If you take the train, it’s pretty much a full day’s journey between the two, by the time you check out, get to the train station, train ride, then get to your new place. So you can count Day 4 as a night in Prague, but it’s not actually a sightseeing day in either.
You could do a long day trip to Dresden from Prague. It’s a 2 or 2 1/2 hr train ride each way, with about 7ish hours in the city. Only you know if it’s worth it or not. I assume you would like to go to the Green Vaults. Maybe check ticket availability before you decide.