http://revach.net/article.php?id=4845

Section: Parshas HaShavua   Category: Quick Vort
Parshas Vayeishev: Maharal MiPrague - Yosef Sits In Jail An Additional Two Years

Rashi says (Vayeishev 40:23) that Yosef was punished with an extra two years in jail because he relied on the Sar HaMashkin to be the Shaliach for a miraculous redemption. The Maharal explains why Yosef received precisely a two year sentence.

The Maharal says that this was Mida K'Neged Mida. For a full year Yosef waited expectantly for the Sar HaMashkin to repay his debt of gratitude and help free him. When the year was over Yosef gave up. If he hadn't done anything for a full year, surely he never will. We see this in the Gemara (Brachos 658b) that if a person sees his friend after not seeing him for a full year, he makes a bracha of Michayeh HaMeisim since after a full year he already wrote him off, like the dead, who we stop focusing on after a year.

"Vayishkacheihu" or he forgot him, says the Maharal is gematria "Shana" or one year. Hashem made the Sar HaMashin forget for only one year. After that it was perfectly natural for him to forget without any divine interference. Because Yosef waited for one year he was punished for one year, leaving him there two years longer.