Winter if you ski: December to March. Summer if you hike: July to September.
These are high seasons. May can be nice and a good option, but you have to manage expectations. Many come north expecting May and June to be summer in the mountains. It's not. The snow won't melt off many of the most popular trails until July, and late July at that. In May, Lake Louise will be frozen over with some water showing mid month. Some of the path around the lake; near the lodge, MIGHT be melted out, but you would need to be prepared to hike on snow or snowshoe for the trails. Same thing, with more snow, as you move north along the Icefields Parkway up to Jasper. The road to Moraine Lake probably won't be melted out yet. The few trails that are open, like the Johnston Canyon hike , will be packed like a conga line both coming and going. All the crowds are condensed into the few areas that are open.
On the other hand, it is all gorgeous and the critters are out and about and easier to see. You can get some good bargains in timeshares especially on the west side. The Columbia Valley from Fairmont Hot springs north is green with lots water and full of birds migrating. There's a bird festival in early May. The drive from Radium Hot Springs through Kootenay NP is prime for being able to see bears etc out filling up after hibernating; they are all down low where the snow has melted off.
So it really depends on the individual. If you haven't been before and want to see the iconic stuff, wait until July-Sept. If you've been there multiple times in the summer, then a shoulder season trip might work.
Sue