Since I don't have time to practice 8 hours a day, that never becomes an issue. There are times that I get fairly obsessed with a new piece of music, and end up playing the same phrases for a couple of hours on end without much of a break. That gets my fingers, hands, and wrists pretty sore. I practice a form of chi-gong that works all the joints and muscles pretty well to keep things loosened up.
I don't want to turn this into another Effortless Mastery thread, but it does tie in. Our first instinct when picking up the instrument should be to breath and relax. There should be no strain whatsoever. It's easy to get lost in the music (and perhaps our fears about not being good enough) and before you know it, you're all tensed up again. That's when we need to stop, put the thing down, stretch, breath, relax and start again. Keep sending the message to the body that it's all about being relaxed and having an experience of pleasure, not pain. I've gotten much better at catching myself in the last couple of years when it comes to this.
Musicians are athletes of the fine muscles. Taking care of our bodies as other athletes do should be a top priority. I think your teacher did you a huge disservice by telling you to ignore the pain you were having. I sure hope you can bring about a recovery and get back to playing again. Thanks for sharing your story.