"And Pharaoh commanded his men concerning him" (Genesis 12:20). Rabbi Joshua ben Levi said: because of the four cubits that Pharaoh escorted Abraham, as it says, "And Pharaoh commanded his men concerning him, and they sent him away," his descendants were enslaved four hundred years, as it says, "And they shall serve them, and they shall afflict them four hundred years" (Genesis 15:13).
Four Cubits of Escort and Four Hundred Years of Bondage
Yalkut Shimoni on Torah 69:2
וַיְּצַו עָלָיו פַּרְעֹה אֲנָשִׁים. אָמַר רַבִּי יְהוֹשֻׁעַ בֶּן לֵוִי, בִּשְׁבִיל אַרְבַּע אַמּוֹת שֶׁלִּוָּהוּ פַּרְעֹה לְאַבְרָהָם, שֶׁנֶּאֱמַר, וַיְּצַו עָלָיו פַּרְעֹה אֲנָשִׁים וַיְשַׁלְחוּ וְגוֹ' נִשְׁתַּעְבְּדוּ בָּנָיו אַרְבַּע מֵאוֹת שָׁנָה, שֶׁנֶּאֱמַר, (בראשית טו, יג) "וַעֲבָדוּם וְעִנּוּ אוֹתָם אַרְבַּע מֵאוֹת שָׁנָה".