God uses a variety of ways to communicate with humans such as through visions, signs and wonders, angels, shadows and patterns, and many others. One of the most common means used in Scripture to convey his will is through dreams (Numbers 12:6).
The word "dreams" occurs the most times in the book of Genesis (33 total occurrences) followed by the book of Daniel (27 times) in the King James translation. Both words occur only eight times in the entire New Testament. Interestingly, the only two people Scripture states were blessed with the ability to correctly interpret them were Joseph (Genesis 40:12, 13, 18, 19, 41:25 - 32) and Daniel (Daniel 2:16 - 23, 28 - 30, 4).
Dreams occur when a person sleeps while visions usually happen during waking hours. Scripture, however, is sometimes not fully clear whether God is communicating with someone via this method or a vision. For example, Daniel 2:19 states that a secret was revealed to the prophet in a 'night vision.' It is unknown whether Daniel was or was not sleeping when the event occurred (see also Daniel 7:1 - 2).
Who had them?
The dreams of several Old Testament people are recorded in Scripture. They include King Abimelech of Gerar (Genesis 20:3), Jacob (Genesis 28:12, 31:10), Laban (Jacob's employer - Genesis 31:24), Joseph (Genesis 37:5, 9) and an imprisoned butler and baker (Genesis 40).
Still others whom the Bible records include Egypt's Pharaoh (Genesis 41), Midianites who will soon be conquered by Gideon (Judges 7), King Solomon (1Kings 3:5), King Nebuchadnezzar of Babylon (Daniel 2:3, 4) and the prophet Daniel (Daniel 7).
The details of what Joseph, Jesus' stepfather, dreamt on three different occasions is recorded in the New Testament (Matthew 1:20 - 23, 2:13, 19 - 20). A fourth one, where he is warned not to live in Judea, is also referenced (Matthew 2:22).
The wise men who came to worship Jesus dreamt of being told not to visit Herod the Great on their way back home (Matthew 2:12) and Pilate's wife had a disturbing one about her husband's judgment of Christ (Matthew 27:19).
What is their purpose?
Scripture records at least twenty dreams that they were used by God for a variety of purposes.
They can warn a person not to do something (Genesis 20:3, 31:24, Matthew 27:19).
They can convey what will happen either in the near or distant future (Genesis 37:5, 9, 40:8 - 19, 41:1 - 7, 15 - 32, Daniel 2, 7).
They can convey a spiritual truth (Genesis 28:12).
They can confirm a promise (Genesis 28:13 - 14).
They can offer encouragement (Genesis 28:15).
They can inform someone or a group to do something (Gensis 31:11 - 13, Matthew 1:20 - 23, 2:12 - 13, 19, 22).
They can convey to an enemy their destruction (Judges 7:13 - 15).
The can offer a person a gift from God (1Kings 3:5).
Dreams can warn a person they will receive punishment for their sins (Daniel 4).
Is it always the truth?
A busy schedule during the day can produce dreams at night (Ecclesiastes 5:3). They can also arise out of our own vanity and lusts (Ecclesiastes 5:7, Jude 1:8). According to the Bible, they commonly convey information and portray events that do not reflect the truth but rather represent our own vivid imaginations (Isaiah 29:8, Zechariah 10:2)!
If certain dreams come from God then it makes sense that only He can reveal their true meaning (Genesis 40:8, Daniel 2:27 - 28). Those who believe the Eternal is communicating with them using this method ought to pray and humbly ask if what they saw came from him.
A stern warning
God offers stern warnings against those who use what they supposidly see while sleeping as a means to convince others to break His laws and rebel against worshipping him. In ancient Israel, those who practiced such things received the ultimate penalty.
"If a prophet rises among you, or a dreamer of dreams, and gives you a sign or a wonder, And the sign or the wonder which he foretold to you comes to pass, saying, 'Let us go after other gods . . . (they) shall be put to DEATH . . ." (Deuteronomy 13:1 - 3, 5, see also Jeremiah 23:25 - 27, 32).
Although the New Testament gives far less significance to them than the Old Testament, it does state that just before the return of Jesus to earth that God will cause his people to have special dreams. The Bible records the apostle Peter, citing Joel 2, stating such a fact when he preached a powerful message on the day of Pentecost (Acts 2:17).