Back before there was a family called the Children of Israel, God told Abram (later Abraham) that the great nation which would come from his family would be slaves for 400 years. In Genesis 15:13 there is a foretelling, or prophecy, that the Children of Israel would be strangers in a strange land. Israel would be afflicted as servants.
Certainly this was not a comforting promise from God to Abram. However, when the Children of Israel were living in bondage in Egypt, they probably took comfort in knowing that God would bring them out of their bondage. Besides the promise of escaping from slavery, God promised to punish the nation which held them. After this punishing, they would leave the land with “great substance.” (Genesis 15:14)
It is true that when the 12 tribes of Israel left Egypt they left with great wealth. In Exodus 12:35, 36 the people of Egypt were willingly giving their riches to their slaves so that they would leave and not need to return. The Bible says that they “spoiled the Egyptians.” Spoiling in the sense that they took all the gold, silver and clothing that the Egyptians would give them.
According to Exodus 12:40 and 41, Israel spent a total of 430 years in the land of Egypt.
There are several verses in the Bible which talk about this 400-430 year time period. Genesis 15:13, 14; Exodus 12:40, 41; Acts 7:6 and Galatians 3:16, 17.