I believe that the number seven is primarily symbolic, representing completeness, or, in this case, every ruler of this kind. The angel does make some use of the number in a seemingly literal sense in speaking of "seven mountains" and "seven kings"(17:9-10).
Since a mountain and a king are both ways in which kingdoms are symbolically spoken of in prophecy, it is hard to know whether that is the case here or not. Interpreters like to take the "seven mountains" to be a reference to Rome as the "city on seven hills," and the "seven kings" (which then is expanded to eight! 17:11) as the same number of rulers (emperors?) or successive empires (e.g., Babylonia, Egypt, Assyria, Babylon, Media-Persia, Greece, Rome...?).
Whether "seven" is indeed intended as a literal number in these instances, or not, is not certain. If so, it does not in any sense rule out the primarily symbolic significance.
For example, the "seven churches" in Revelation 1-3 were seven actual churches, but their number is chosen, no doubt, to represent "the whole church," since there are known to have been more than seven (at least ten) churches in Asia in John's day.