What does the parable of the ten virgins teach?
The parable of the ten virgins teaches that the kingdom of heaven is like ten virgins waiting for a bridegroom, five wise and five foolish, and it warns believers to be watchful and prepared, since only those who are ready will enter in with the bridegroom while the door is shut to the unprepared.
Jesus told the story of ten virgins who took their lamps and went out to meet the bridegroom. Five of them were wise and took oil with their lamps, while five were foolish and took no oil. While the bridegroom delayed his coming, all ten grew drowsy and fell asleep. Then at midnight a cry rang out, "Behold, the bridegroom cometh; go ye out to meet him," and all the virgins rose to trim their lamps.
At that moment the foolish virgins discovered their lamps were going out and had no oil, so they begged the wise ones to share, but the wise refused, telling them to go and buy oil for themselves instead. While the foolish virgins went to buy oil, the bridegroom arrived, and those who were ready went in with him to the marriage, and the door was shut. When the foolish virgins finally returned and knocked, calling "Lord, Lord, open to us," the bridegroom answered, "Verily I say unto you, I know you not."
Jesus closes the parable with the plain application: "Watch therefore, for ye know neither the day nor the hour wherein the Son of man cometh." The parable teaches that being ready matters more than simply being present or waiting; readiness cannot be borrowed from someone else at the last moment, and once the door is shut, it is too late to gain entrance. It stands as a warning to remain spiritually prepared and watchful, since no one knows exactly when the Lord will return.
The scriptures
Then shall the kingdom of heaven be likened unto ten virgins, which took their lamps, and went forth to meet the bridegroom. And five of them were wise, and five were foolish. They that were foolish took their lamps, and took no oil with them: But the wise took oil in their vessels with their lamps. While the bridegroom tarried, they all slumbered and slept. And at midnight there was a cry made, Behold, the bridegroom cometh; go ye out to meet him. Then all those virgins arose, and trimmed their lamps. And the foolish said unto the wise, Give us of your oil; for our lamps are gone out. But the wise answered, saying, Not so; lest there be not enough for us and you: but go ye rather to them that sell, and buy for yourselves. And while they went to buy, the bridegroom came; and they that were ready went in with him to the marriage: and the door was shut. Afterward came also the other virgins, saying, Lord, Lord, open to us. But he answered and said, Verily I say unto you, I know you not. Watch therefore, for ye know neither the day nor the hour wherein the Son of man cometh.
From the books
This answer is drawn from these passages in the Mary Banks Faith Library.