July and August are the warmest months of the year in Moscow, and by far the best time to visit. The city practically freezes from November through until April, and there is a lot of snow.
Spring is a warm relief after the thaw, and May is a pleasant time to visit, when Moscow is neither too hot nor cold, and there are several anniversaries and events that the city celebrates.
In truth you can visit the city of Moscow at almost any time of the year that you choose, and you will still find that all of the attractions are open, sometimes covered in ice, but open nonetheless.