The Torah does not explicitly state when exactly the famine erupted and caused Yitzchok and Rivkah to move to G'ror. The Torah does put the story after the incident of Eisav selling his birthright, which occured when Avraham died (at 175) when the twins were 15 years old.
Logically it could not have occurred while they were growing up, because it would have been too hard to hide the children and keep their identity (as children of Yizchak and Rivkah) secret. Thus, it could only have occurred during the twenty years before they were born or after Avraham had died.
This depends on and argument as to whether or not the Torah tells things in chronological order or not. If the Torah does not necessarilyput things in chronological order (Ain mukdam u'meuchar baTorah) as Rashi says, then we cannot know when the incident occured. We can make a logical argument that Avraham was still alive during those twenty years and a famine that chased Yitzchak away and forced him to resettle would have affected Avraham as well. If he had been around, his reputation would probably have affected thecourse of events. THe memory of what occurred when he was in Gror would have protected Yitzchak.
On the other hand, if the Torah does list events in chronological order (Yaish mukdam u'meuchar batorah), then the events had to have occurred after the sale of the birthright. The question does arise, where were Yaakov and Eisav? This seems to imply that they were older and had already been on their own.
It would seem that Eisav had not yet married as the news of his marriage would have spread and made the ruse impossible. We know that Eisav married at the age of 40, in order to emulate his father. Professor Nechama Leibowitz brings up the point that Eisav actually led a band of fighters and used them to defend the family. She states that this can explain why the shepherds of G'ror used "lawfare" to harass Yitzchak rather than attacking him and attempting to take the wells away.
The Torah says that they caused problems and disputed the ownership of the wells. Professor Leibowitz says that this is because they did not dare to attack directly.
This seems to limit the priod of time in which the famine occured and Yitzchak was able to claim that Rivkah was his sister. After that he settled in B'er Shevah for the rest of his life.