Gracie Allen was a 20th century American comedian and television actress. She was married to George Burns. They performed together as the comedy duo "Burns and Allen".
They would end their stage shows and television program with the immortal phrase "Say goodnight, Gracie." This phrase made its first appearance at the Roxy Theater in New York City, in 1932. After attempting to learn humor, with little success, Data accidentally paraphrased their hallmark and elicited laughter among the crew on the USS Enterprise-D. (TNG: "The Outrageous Okona")
Given the pairing of the two names, the humpback whale, Gracie, in Star Trek IV: The Voyage Home was (presumably) named by the staff at the Cetacean Institute for Allen.
A line in DIS: "If Memory Serves" is a homage to George Burns and Gracie Allen's classic "Say goodnight, Gracie" joke.