Rav Yosef Karo: 400 Years
[The purpose of the subjugation in Egypt was to prevent the Sitra Achra from suckling impurity.] For the more the body suffers, the more the power of that impurity rots and weakens. Therefore God said to Abraham at the time [of the Covenant of the Pieces]: “For your seed [offspring] will be a sojourner in a land that is not theirs.” This means that in order to weaken and block the serpent’s impurity from the Sitra Achra, it was necessary to subjugate and oppress the Children of Israel for four hundred years in correspondence with the four feet of the Chariot [in Ezekiel’s vision].
For this reason they had to engage in four different types of work, as it states: they embittered their lives with hard work—one; bricks—two; mortar—three; hard labor in the field—four [see Exod. 1:14]. “Bricks” refers to Knesset Israel; “mortar” refers to tiferet; “the field” hints at the field of apples.