Professor McGonagall knew Mrs Longbottom from Hogwarts.
It's less clear whether she knew her in the capacity of a teacher or as a fellow-student. However, Professor McGonagall has been at Hogwarts for a long time, potentially long enough to have taught Mrs Longbottom as a student.
How long have you been teaching at Hogwarts?" Professor Umbridge asked.
"Thirty-nine years this December," said Professor McGonagall brusquely, snapping her bag shut.
(Order of the Phoenix, Chapter 15, The Hogwarts High Inquisitor).
If she wasn't a teacher at the time then Minerva McGonagall still would've come across Mrs Longbottom at Hogwarts, unless Mrs Longbottom is very old indeed. There was only a two year period where McGonagall was not at Hogwarts.
Though a most efficient and gifted employee, and fond of her much older boss, Elphinstone Urquart, Minerva was unhappy in London, and found that she missed Scotland. Finally, after two years at the Ministry, she was offered a prestigious promotion, yet found herself turning it down. She sent an owl to Hogwarts, asking whether she might be considered for a teaching post. The owl returned within hours, offering her a job in the Transfiguration department, under Head of Department, Albus Dumbledore.
(Pottermore, "Professor McGonagall").
We don't have a canon statement on Augusta Longbottom's age, as far as I'm aware, which makes pinning down when she was at Hogwarts quite tough. We know that her son, Frank, was a fully trained Auror by the time he was tortured into insanity around 1981. This would mean that he was in his late teens at the earliest, although he could've been much older. Since McGonagall started teaching in 1956 she would almost certainly have taught Frank. Whether she taught Augusta depends on Augusta's age, which we can't pin down as far as I'm aware.
It would be surprising for McGonagall to know Mrs Longbottom's Charms results if they weren't at Hogwarts together. We can't be definitive, I'm afraid, but I think McGonagall's confident assertion is proof enough that her time at Hogwarts overlapped with Augusta's at some point, whether as student or teacher. She wouldn't be privy to that information otherwise.