It depends what the book is. For science fiction (or fantasy) stories like this, it's pretty common. And many are actually pretty active on social media as well.
Probably the most well known example is Neil Gaiman who is extremely active on tumblr, at least prior to Elon used to be extremely active on twitter, and would regularly drop into discussions of their works.
Other notable examples (albeit less active) off the top of my head include James S.A. Corey (Daniel Abraham and Ty Frank) and Andy Weir.
Just yesterday, my spouse was unpacking and came across a stack of envelopes containing correspondence I had received from authors I'd written to as a kid. I know then it felt really magical to have them write to me, especially since most of them were actually hand-written and discussed what I said meaningfully.
I don't remember it being a result of a teacher prompting me, though I suspect it was. They weren't books I read in school, but perhaps a teacher asked us what books were our favorites and had us send out letters. They're all laminated, too, which makes me think the teacher(s) took them and preserved them for us.
The only celebrity mail I recall writing, definitely as a class requirement, was to Carl Sagan. I was very disappointed to receive a form letter from his secretary in response.
Whenever I read a good book, see a great film, or appreciate an art piece, I try to track down the creator to send them a note of thanks. I'd say maybe 30% reply?
That said, I can't imagine creating something that people are still directly impacted by 60 years later. Software just doesn't seem to work like that
I do this with bands I really like, particularly newer groups whose first "hit" I cannot get out of my head. Few respond, but the point is I directly give them more money than they'd get through their label's playcount.
Hint to artists: put up a bitcoin receiving address on your portfolio (it'd make it a bunch easier).
Elie Wiesel responded to one of my specific questions [in his classroom response letter, decades ago]. Very powerful moment (hopefully not staged by my great English teacher of yesteryear).
Amazing huh? Me and my daughter finished this Dutch bedtime story book, and we wrote the artist to to tell him how much we liked his work. We actually received a heartwarming reply back, in which he gracefully accepted the compliment, and wished us well.