How long you want to stay in a city will totally be up to you. Some people are fine just staying a night or 2. Others....like me would rather stay 4-5 nights. I think you get a better feel for a city if you get to check it out longer. Of course...some cities turn out to suck and you want nothing more then to get out.
You're better off to book shorter periods of time and if you like the place enquire about staying longer when you've made up your mind. Its usually easier to add additonal nights then to cancel booked ones.
One thing you'll have to keep in mind about travelling in July is that it is the peak season. I doubt you'll have too much trouble finding a place to rest your pack, but the more populare places will probably book up fast. You may want to book ahead 3-4 days. You'll be fine though, don't worry about it. You'll amaze yourself what you can come up with when you're in a bind!!
And if you end up sleeping in a park
its all part of the expierence right? Plus it'll make a great story when you get home!!