If you're retired and want to have smaller crowds then the first two weeks of June or the last week of August through mid-Sept. is good for this trip.
Each national park has a wonderful web site with lots of good information such as things to do, campgrounds, road information and special 'alerts'. Check them out.
https://www.nps.gov/yell/planyourvisit/campgrounds.htmhttps://www.nps.gov/grte/index.htmFor Grand Teton Nat'l Park try to stay in the park itself at Colter Bay RV park if you need hookups. If you enjoy dry camping, stay at either Colter Bay campground - right next door to Colter Bay RV or a little farther south in the park toward Jackson is Gros Ventre campground (our favorite). Both of the dry campgrounds have 300 non-reservable sites but even with our 40' motorhome we've always gotten a site. They rarely fill and won't be full in the shoulder seasons.
Here's a good road information detail for RVers: Note that from Red Lodge you will have a very steep mountain road to take to get into Yellowstone from that direction so keep it in mind. In May you would probably have snow issues to carefully check on.
http://www.rvtechmag.com/travel/4_yellowstonebyrv.phpIt makes no difference which park you do first as they're right next to each other.