As for calendar days, I can personally only suggest you look online. But when you visit, the earlier the better! Especially for the road to the sun. It's a very popular location, and if you arrive later in the day parking will be a nightmare.
Late in the day is good too. We drove through in the morning then visited two medicine in the southeast corner then back through after dinner. Much less busy and alot more wildlife to see. This was 2 weeks ago. We also took the red bus tour the day before from lake McDonald to Logan pass and back. You definitely see more in the opened top bus, and don't have to personally drive through the traffic. Plus the guides are great and tell you about stuff you normally wouldn't notice.
If you want fewer people, also consider the northern parts of the park. They are a LOT less busy (but also less dramatic, though still very beautiful). We did hikes along the road to the sun, and it was quiet busy in July (still amazing ;)).
In the spring or the fall but still alot less people then Yellowstone national park
Thanks! Your answer is awaiting moderation.