In the days of Samuel the prophet the Philistines battled and overcame Israel, taking the Ark of the Covenant back to their land. The Ark brought such calamities on the Philistines that after seven months they gave it back to the Israelites. It ended up in the city of Kirjath-jearim, which is several miles west of Jerusalem. Israel had to wait at least 20 years (1Samuel 5 - 7) before the Ark would be moved again.
Solomon spent seven years building the house of God in Jerusalem and another 13 building his own home for a total number of 20 years. After he had completed both buildings Solomon gave Hiram, the king of Tyre, twenty cities in the land of Galilee (1Kings 9:10 - 11).
How is the number 20 related to sleep?
The scriptures record at least twenty separate messages conveyed while a person is sleeping. God, through a dream, warned Abimelech not to go near Abraham's wife (Genesis 20:3). Jacob dreams of a ladder to heaven (Genesis 28:12) and is told in a second one to leave his employer (Genesis 31:10). Jacob's employer Laban is warned to leave the patriarch alone (Genesis 31:24). Joseph dreamt of his brothers bowing before him (Genesis 37:5) then dreamt his parents would do the same (verse 9). A butler and a baker, in a Egyptian prison, dream what their fates will be (Genesis 40). The Egyptian Pharaoh is informed two different times, while he is sleeping, about the country's food stores over the next fourteen years (Genesis 41). A person in the Midianite army dreams of Gideon conquered his people (Judges 7). King Solomon, while sleeping, is offered by God ANYTHING he wants (1Kings 3:5). Babylon's king has it revealed to him all the world empires to exist until Christ's return (Daniel 2:3) and his punishment for being so vain (Daniel 4). Daniel is also told while he sleeps about four great world empires (Daniel 7).
Only five dreams are mentioned in the New Testament, Three of them occur to Joseph, Jesus' step-father, regarding the birth of Christ and protecting the young child from Herod the Great's wrath (Matthew 1:20 - 23, 2:13, 19). The Parthian Magi are informed by a dream to not visit Herod on their travel home (Matthew 2:12) and Pilate's wife receives a troubling dream warning that her husband should not do anything to harm Jesus (Matthew 27:19)
Additional information on the Biblical Meaning of 20
God promised Abraham that if he found only 20 righteous people in Sodom and Gomorrah he would not destroy both cities (Genesis 18:31). Samson was Judge over Israel twenty years (Judges 15:20, 16:31).
The book of Hebrews uses over 20 different names and titles for Jesus Christ.