.There is a ride for the living bike ride in Krakow end of June would visit Berlin eary July but wonder if end of May or Sept is better for crowds and weather?
Berlin has annualy a lot of visitors in September due to fairs and events.
For indication on weather of last years you can check climate tables of both destinations but it can differ very much for the same date at different years.
We were in Berlin during July one summer and it was cool enough to wear a sweater and/or jacket. I always seem to be chilly. Kraków is a little warmer in July but we didn't wear shorts at all.
I enjoyed my July trip to both Berlin and Krakow, weather was warm and pleasant with a couple of 90 F days. I didn't find crowds an issue in either city. I don't think either of them are besieged like the big 3 in Italy.