they were not given authority to kill
Given is ἐδόθη [edothē] , passive, it is divine permission which prevents them from killing their victims. It is Gods intention that their victims will be unable to escape the torment of the locusts through death. This is similar to the limitation which God put on Satan in Jobs testing (Job Job 2:6).1 God ultimately desires to keep these people alive so that they have the opportunity to repent and turn to Him:
After millennia of captivity, the vile demons would no doubt want to give full vent to all of their pent-up evil by slaughtering people. Certainly Satan would want to kill all the unregenerate to keep them from repenting. But God, in His mercy, will give people torment for five months (the normal life span of locusts, usually from May to September), during which they cannot die but will be given the opportunity to repent and embrace the gospel.2This verse frustrates those who attempt to interpret the judgment as involving an army of human origin, for what army on earth has ever resisted killing the enemy?
to torment them for five months
In Revelation Rev. 9:10+ we are told Their power was to hurt men five months. It is not clear whether the ministry of the locusts is limited to that period of time or whether the effects of their sting lasts for five months. Probably the former. The time period may be intended to convey the idea of Gods complete provision for their torment. Significantly, in the judgment of the flood, the waters prevailed upon the earth for the same period of time, five months (150 days, Gen. Gen. 7:24).3 See Five: Provision, Fullness, Grace.
The duration of the plague is fixed. It is to last five months. A similar fixed date is given in Numbers Num. 11:19-20: a whole month. In 2 Samuel 2S. 24:13, also we have seven years, three months, and three days, as the fixed limit of certain judgments. These periods are always taken literally. Why not this? The time limit of these infernal locusts corresponds with that of ordinary locusts, which is five months (from May to September).4like the torment of a scorpion when it strikes a man
1 Concerning Gods use of evil for His own purposes: Jdg. Jdg. 9:23; 1S. 1S. 18:10; 1K. 1K. 22:22; 2K. 2K. 19:7; 2Chr. 2Chr. 18:21; Job Job 1:12; Job 2:6; Isa. Isa. 37:7; Mtt. Mat. 4:1; Luke Luke 22:31; John John 19:11; 1Cor. 1Cor. 5:5; 1Ti. 1Ti. 1:20; 2Cor. 2Cor. 12:7; Rev. Rev. 2:10+; Rev. 9:5+; Rev. 9:15+; Rev. 16:14+; Rev. 17:17+; Rev. 20:3+; Rev. 20:8+.
2 John MacArthur, Revelation 1-11 : The MacArthur New Testament Commentary (Chicago, IL: Moody Press, 1999), Rev. 9:5.