From personal experience, through what we saw with our DDalmost10 a few years ago, I would say that they wither and hide the longer they are in the situation. We knew that something needed to change for DD a couple of years ago when she became sullen and uninterested in school or learning about anything. When we finally got her talking about what was going on she said things like: "it's not that I have no friends, because I do, and I like my teachers, but I am just really tired of nobody understanding what I'm talking about or what my questions are about...so I've just stopped talking and asking questions and tried to be interested in what everyone else is interested in."
When we talked to her about alternatives for the following school year, her first comment was "I'll give it a try as long as I'll be able to talk to someone about interesting stuff."
We had heard that it was really important for gifted kids to be properly placed by third grade, especially girls or they will be lost and start to shut down in school. When we starting seeing it with a previously voracious learning it was scary! It took the entire summer vacation and a month or so of home schooling before her appetite for learning came back. We have luckily been able to keep at least part of her schooling to include some challenge so that spark doesn't die, but it is really hard to keep her from hiding in certain situations because she wants to fit in more than stick out.