The recognized whale watching season for Alaska is May through September, although a few stragglers might be seen near-ish this time on their journey to or from elsewhere in the Pacific, such as Hawaii or Mexico.
If you're lucky, you may see some from your cruise ship but you can certainly make an excursion of the event as there are plenty of pre-planned activities offered within the cruise industry or as result of the presence of cruise passengers.
Humpback whale breaching in the waters of Kenai, Alaska
You might catch glimpse of the gray whale, beluga, orca (killer whale), regionally renown humpback whale, and even the gigantic blue whale!
Here's where Kenai is, a little west from Anchorage and somewhat northwest along Alaska's Pacific Coast from where many glacier-viewing cruise itineraries stop in Juneau.