Hi,
the rainy season (almost continuous rain for a month) approximately lasts from June 15th to July 15th. Also, it can rain a lot during the typhoon season (september). When a typhoon comes, it rains a lot for one or two days, but weather can actually be quite nice before or after the typhoon.
Your best chance for good weather in Japan is probably October to May. August is the best in summer.