The second Psalm is a military prayer telling us that those who fight against the Lord will not succeed. In fact, the Lord will destroy them. It is, however, also a Messianic Psalm, speaking of the son whom the Lord has begotten (referring to the coming of the Messiah).
Four of the twelve verses in this Psalm are quoted in the New Testament.
Verses 1 and 2
1 Why do the heathen rage, and the people imagine a vain thing?
2 The kings of the earth set themselves, and the rulers take counsel together, against the Lord, and against his anointed...
These two verses are quoted in Acts 4:25-26
Here Peter and John, after healing a lame man from birth, are preaching to the people when the captain of the temple with the Chief Priests take them into custody. The Jewish leaders are trying to figure out how to stop them from preaching and healing in the name of Jesus. Since the people believe in them they can't figure out a way to punish them so they reprimand them and let them go. When Peter and John return to their friends and tell them all that happened they say a prayer of thanks and praise that the Lord has shown his power through them. Within that prayer they include a quote of these 2 verses of David's prayer in Psalms 2 as they are learning that those who appose the Lord will not succeed.
Acts 4:24-26
24 And when they heard that, they lifted up their voice to God with one accord, and said, Lord, thou art God, which hast made heaven, and earth, and the sea, and all that in them is:25 Who by the mouth of thy servant David hast said, Why did the heathen rage, and the people imagine vain things?
26 The kings of the earth stood up, and the rulers were gathered together against the Lord, and against his Christ.
Psalms 2:7
As Paul and Barnabas were going from city to city to preach the gospel they came to Antioch and on the Sabath (Saturday) they went into the synagogue during the meeting. After the reading of the scriptures they were told that if they had any word of exhortation they were permitted to speak. Paul then stood to speak. He told his fellow Jews that God had chosen their people (the House of Israel over the gentiles) and brought them out of Egypt with power. Paul then recounts the history of the people, how the Lord destroyed seven nations so they could move into their land, then about the people first having judges and then kings. Paul quotes from the scriptures six times during this speech to support what he is saying. Two are from Psalms 89:20 and 1 Samuel 13:14 to talk about how the Lord chose David as a king and that a Savior, even Jesus, would come from his seed as was promised. He then talks about John the Baptist whom many thought to be the Messiah and how John told the people that there was another coming after him. Then comes the difficult part of his speech. He says that the person John was talking about did come but even though the rulers read the scriptures that talk about him every Sabbath they didn't recognize him and so they fulfilled all of the scriptures that said they would condemn him and have him put to death. Fortunately God raised him from the dead and he was seen for many days by his disciples who came up with him from Galilee to Jerusalem (Jerusalem was considered the high place both physically and spiritually so the disciples came up spiritually with Jesus to Jerusalem as well as literally up the hill). So here Paul declares glad tidings that the promise that was made to the fathers has been fulfilled to them as the children in that he has raised Jesus up again. He then quotes verse 7 of Psalms 2 in verse 33 of Acts 13.
Psalms 2:7 I will declare the decree: the Lord hath said unto me, Thou art my Son; this day have I begotten thee.
As quoted in Acts 13:33
33 God hath fulfilled the same unto us their [the fathers] children, in that he hath raised up Jesus again; as it is also written in the second psalm, Thou art my Son, this day have I begotten thee.
(Though the rest of Acts 13 has nothing to do with Psalms 2 here is a brief summery of what happens to finish the story.) Paul continues to quote from Isaiah 55:3 about the "Sure mercies of David" referring to Christ. And Psalms 16:10 about Christ not seeing corruption (since David died and was buried with his fathers this scripture could not be referring to him). He also quotes from Habakkuk 1:5 which tells them (the Jews) they will not believe. Of course Paul and Barnabas are rejected by the Jews but the Gentiles accept them and ask them to come preach to them. This is the famous turning point when Paul, through instructions from the scriptures in Isaiah 49:6 (see verse 47 of Acts 13), begins his full time efforts to preach to the gentiles.
Psalms 2:9 -
9 Thou shalt break them with a rod of iron; thou shalt dash them in pieces like a potter’s vessel.
Is quoted in Revelation 2:27
In chapter 2 of Revelation, John tells the church at Ephesus that they are doing some things right but need correction in some areas. He goes on to tell of both good and bad and finally towards the end of the chapter he quotes from Psalms 2 verse 9 by saying that if the church keeps the commandments they will rule over the nations.
Revelation 2:26-27
26 And he that overcometh, and keepeth my works unto the end, to him will I give power over the nations:
27 And he shall rule them with a rod of iron; as the vessels of a potter shall they be broken to shivers: even as I received of my Father.