If you can, be there first thing in the morning (with one extra hour if you stay onsite) and be prepared to walk fast. Both Potter worlds are far from the gates and everyone rushes there at opening. I would do either Escape from Gringott or Forbidden Journey (depending on your starting park), ride the Hogwart Express, do the other big ride and then spend the rest of the day visiting the other rides, shops and restaurants and using the train to switch between the two parks. The train ride is different in each direction. Once Escape and FJ are out of the way, even on busy days, it's a much more leisurely visit. And if you are early enough, you might get to ride them 2-3 times in a row before the line gets too long.
Also, bring something to note your locker code (if you have a bad memory like me). A lot of rides at UO requires that you use them.