The Holy Bible, Revelation 20:7-10

7 And when the thousand years are expired, Satan shall be loosed out of his prison,

8 And shall go out to deceive the nations which are in the four quarters of the earth, Gog and Magog, to gather them together to battle: the number of whom is as the sand of the sea.

9 And they went up on the breadth of the earth, and compassed the camp of the saints about, and the beloved city: and fire came down from God out of heaven, and devoured them.

10 And the devil that deceived them was cast into the lake of fire and brimstone, where the beast and the false prophet are, and shall be tormented day and night for ever and ever.

The Doctrine and Covenants, Section 88:110-116

110 And so on, until the seventh angel shall sound his trump; and he shall stand forth upon the land and upon the sea, and swear in the name of him who sitteth upon the throne, that there shall be time no longer; and Satan shall be bound, that old serpent, who is called the devil, and shall not be loosed for the space of a thousand years.

111 And then he shall be loosed for a little season, that he may gather together his armies.

112 And Michael, the seventh angel, even the archangel, shall gather together his armies, even the hosts of heaven.

113 And the devil shall gather together his armies; even the hosts of hell, and shall come up to battle against Michael and his armies.

114 And then cometh the battle of the great God; and the devil and his armies shall be cast away into their own place, that they shall not have power over the saints any more at all.

115 For Michael shall fight their battles, and shall overcome him who seeketh the throne of him who sitteth upon the throne, even the Lamb.

116 This is the glory of God, and the sanctified; and they shall not any more see death.

Bible Dictionary: Gog

(1) A Reubenite (1 Chr. 5:4).

(2) King of Magog, whose invasion of Israel was prophesied by Ezekiel (Ezek. 38–39). The prophecy points to a time when the gentile nations of the north would set themselves against the people of God and would be defeated and led to recognize Jehovah as King. All this appears to be at the Second Coming of the Lord. Another battle, called the battle of Gog and Magog, will occur at the end of the 1,000 years. This is described by John in Rev. 20:7–9; see also D&C 88:111–16.

Bible Dictionary: Magog

(1) Son of Japheth (Gen. 10:2; 1 Chr. 1:5).

(2) A country or people near the Black Sea, and equivalent to Scythian (Ezek. 38:2; 39:6; Rev. 20:8). See also Gog.

The Guide to the Scriptures: Gog

A king of Magog. Ezekiel prophesied that Gog would invade Israel at the time of the Lord’s Second Coming (Ezek. 38–39). Another battle, called the battle of Gog and Magog, will occur at the end of the Millennium (Rev. 20:7–9; D&C 88:111–116).

The Guide to the Scriptures: Magog

In the Bible, a land and people near the Black Sea. Their king, Gog, shall lead the armies of Magog in a last great battle before the Second Coming of Christ (Ezek. 38:2; 39:6). The scriptures speak of another great battle of Gog and Magog at the end of the Millennium between the forces of God and the forces of evil (Rev. 20:7–9; D&C 88:111–116).

History of the Church, Joseph Smith 5:298

The battle of Gog and Magog will be after the millennium. The remnant of all the nations that fight against Jerusalem were commanded to go up to Jerusalem to worship in the millennium.

Journal of Discourses, Orson Pratt 18:42

Satan will gather his army, consisting of all those angels that fell and left the courts of heaven, when he did, besides all those that will apostatize from the truth, at the end of the thousand years: they too will mingle with the immortal ones of Satan’s army, all being of the same spirit and mind. He with his army will come against the Saints, and the beloved city, and encompass them round about. His army will be so great that it will be able to come upon the Saints on all sides: he is to encompass their camp. Because of the favorable position he is to hold, in that great last battle, and because of the vast number of his army, he doubtless believes that he will get the mastery and subdue the earth and possess it. I do not think he fully understands all about the designs of God: for John tells us when this great army shall be gathered in position, around the camp of the Saints, that “fire came down from God out of heaven, and devoured them.” Devoured whom? Not those who are fallen angels, for they have no bodies to be devoured; but this fire from heaven will devour the wicked apostate race who will have listened to them and who will have joined Satan’s army; they will be consumed, consequently the kingdom of Christ will not be overcome by Satan or taken away from the Saints.