The "time of Jacob's trouble" comes from Jeremiah 30:7...
Jeremiah 30:7 King James Version (KJV)
Alas! for that day is great, so that none is like it: it is even the time of Jacob's trouble, but he shall be saved out of it.
In previous verses, God promised He would someday restore His people to their land....
Jeremiah 30:1-6 King James Version (KJV)
1 The word that came to Jeremiah from the Lord, saying,
2 Thus speaketh the Lord God of Israel, saying, Write thee all the words that I have spoken unto thee in a book.
3 For, lo, the days come, saith the Lord, that I will bring again the captivity of my people Israel and Judah, saith the Lord: and I will cause them to return to the land that I gave to their fathers, and they shall possess it.
4 And these are the words that the Lord spake concerning Israel and concerning Judah.
5 For thus saith the Lord; We have heard a voice of trembling, of fear, and not of peace.
6 Ask ye now, and see whether a man doth travail with child? wherefore do I see every man with his hands on his loins, as a woman in travail, and all faces are turned into paleness?
Despite a great time of distress the Lord would save them from it...
Jeremiah 30:8-11 King James Version (KJV)
8 For it shall come to pass in that day, saith the Lord of hosts, that I will break his yoke from off thy neck, and will burst thy bonds, and strangers shall no more serve themselves of him:
9 But they shall serve the Lord their God, and David their king, whom I will raise up unto them.
10 Therefore fear thou not, O my servant Jacob, saith the Lord; neither be dismayed, O Israel: for, lo, I will save thee from afar, and thy seed from the land of their captivity; and Jacob shall return, and shall be in rest, and be quiet, and none shall make him afraid.
11 For I am with thee, saith the Lord, to save thee: though I make a full end of all nations whither I have scattered thee, yet I will not make a full end of thee: but I will correct thee in measure, and will not leave thee altogether unpunished.
The imagery in the Jeremiah passage most closely resembles the predictions given by Jesus in Matthew 24....
Matthew 24:3-22 King James Version (KJV)
3 And as he sat upon the mount of Olives, the disciples came unto him privately, saying, Tell us, when shall these things be? and what shall be the sign of thy coming, and of the end of the world?
4 And Jesus answered and said unto them, Take heed that no man deceive you.
5 For many shall come in my name, saying, I am Christ; and shall deceive many.
6 And ye shall hear of wars and rumours of wars: see that ye be not troubled: for all these things must come to pass, but the end is not yet.
7 For nation shall rise against nation, and kingdom against kingdom: and there shall be famines, and pestilences, and earthquakes, in divers places.
8 All these are the beginning of sorrows.
9 Then shall they deliver you up to be afflicted, and shall kill you: and ye shall be hated of all nations for my name's sake.
10 And then shall many be offended, and shall betray one another, and shall hate one another.
11 And many false prophets shall rise, and shall deceive many.
12 And because iniquity shall abound, the love of many shall wax cold.
13 But he that shall endure unto the end, the same shall be saved.
14 And this gospel of the kingdom shall be preached in all the world for a witness unto all nations; and then shall the end come.
15 When ye therefore shall see the abomination of desolation, spoken of by Daniel the prophet, stand in the holy place, (whoso readeth, let him understand
16 Then let them which be in Judaea flee into the mountains:
17 Let him which is on the housetop not come down to take any thing out of his house:
18 Neither let him which is in the field return back to take his clothes.
19 And woe unto them that are with child, and to them that give suck in those days!
20 But pray ye that your flight be not in the winter, neither on the sabbath day:
21 For then shall be great tribulation, such as was not since the beginning of the world to this time, no, nor ever shall be.
22 And except those days should be shortened, there should no flesh be saved: but for the elect's sake those days shall be shortened.
We see it in other verses...
Luke 21:22-27 King James Version (KJV)
22 For these be the days of vengeance, that all things which are written may be fulfilled.
23 But woe unto them that are with child, and to them that give suck, in those days! for there shall be great distress in the land, and wrath upon this people.
24 And they shall fall by the edge of the sword, and shall be led away captive into all nations: and Jerusalem shall be trodden down of the Gentiles, until the times of the Gentiles be fulfilled.
25 And there shall be signs in the sun, and in the moon, and in the stars; and upon the earth distress of nations, with perplexity; the sea and the waves roaring;
26 Men's hearts failing them for fear, and for looking after those things which are coming on the earth: for the powers of heaven shall be shaken.
27 And then shall they see the Son of man coming in a cloud with power and great glory.
1 Thessalonians 5:3 King James Version (KJV)
3 For when they shall say, Peace and safety; then sudden destruction cometh upon them, as travail upon a woman with child; and they shall not escape.
And compare these....
Jeremiah 51:6-9 King James Version (KJV)
6 Flee out of the midst of Babylon, and deliver every man his soul: be not cut off in her iniquity; for this is the time of the Lord's vengeance; he will render unto her a recompence.
7 Babylon hath been a golden cup in the Lord's hand, that made all the earth drunken: the nations have drunken of her wine; therefore the nations are mad.
8 Babylon is suddenly fallen and destroyed: howl for her; take balm for her pain, if so be she may be healed.
9 We would have healed Babylon, but she is not healed: forsake her, and let us go every one into his own country: for her judgment reacheth unto heaven, and is lifted up even to the skies.
Revelation 18:2-10 King James Version (KJV)
2 And he cried mightily with a strong voice, saying, Babylon the great is fallen, is fallen, and is become the habitation of devils, and the hold of every foul spirit, and a cage of every unclean and hateful bird.
3 For all nations have drunk of the wine of the wrath of her fornication, and the kings of the earth have committed fornication with her, and the merchants of the earth are waxed rich through the abundance of her delicacies.
4 And I heard another voice from heaven, saying, Come out of her, my people, that ye be not partakers of her sins, and that ye receive not of her plagues.
5 For her sins have reached unto heaven, and God hath remembered her iniquities.
6 Reward her even as she rewarded you, and double unto her double according to her works: in the cup which she hath filled fill to her double.
7 How much she hath glorified herself, and lived deliciously, so much torment and sorrow give her: for she saith in her heart, I sit a queen, and am no widow, and shall see no sorrow.
8 Therefore shall her plagues come in one day, death, and mourning, and famine; and she shall be utterly burned with fire: for strong is the Lord God who judgeth her.
9 And the kings of the earth, who have committed fornication and lived deliciously with her, shall bewail her, and lament for her, when they shall see the smoke of her burning,
10 Standing afar off for the fear of her torment, saying, Alas, alas that great city Babylon, that mighty city! for in one hour is thy judgment come.