The earlier the better but anything before modern times are super interesting!
First of all, when I looked up a few references to what would have been my initial answer, I was delighted to find that since I had last looked at the subject, a new article by Alberto Martinez had appeared, detailing exactly what you are looking for. Reading it heavily corrected my own ideas, and so if you have the opportunity to read it, you should: it's an excellent work that I haven't found any fault with. See below for bibliographical details, but in case you don't have access, my brief summary, with some additions from the history of Western esotericism, is below. Any mistakes are, of course, mine.
In the European context, the idea of "multiple worlds" is, perhaps, best viewed within the context of the pagan-Christian polemic, which has been a consistent thread throughout the history of Western Europe. This thread includes a certain complex of ideas that were first formulated in antiquity, then denounced by Catholicism as part of its ideological programme, then denounced by Protestantism as part of its anti-Catholic polemic, then denounced by Enlightenment thinkers as part of their fight against religion in general. This is important to note that the idea of "aliens" has had a somewhat weird, liminal status from the start, as something that made intuitive sense in a variety of cosmologies, but was also heavily contested. Tl;dr: the fight about aliens is by no means limited to the 20th century.
If we go back to one of the founding fathers of Western civilization, Aristotle, we find this interesting passage:
"It remains to speak of the earth, of its position, of the question whether it is at rest or in motion, and of its shape.
I. As to its position there is some difference of opinion. Most people-all, in fact, who regard the whole heaven as finite-say it lies at the centre. But the Italian philosophers known as Pythagoreans take the contrary view. At the centre, they say, is fire, and the earth is one of the stars, creating night and day by its circular motion about the centre. They further construct another earth in opposition to ours to which they give the name counterearth. In all this they are not seeking for theories and causes to account for observed facts, but rather forcing their observations and trying to accommodate them to certain theories and opinions of their own."
As you can infer, Aristotle was not particularly fond of the interpretation (and accusations of making observations fit theories are older than print)! Note this for later and continue: the Placita Philosophorum, a work from approximately 50 B.C.E., has the following to say about the Pythagoreans:
"[...the beliefs of] Heraclides and the Pythagoreans, that every star is a world in an infinite ether, and each encompasses air, earth and ether; this opinion is current among the followers of Orpheus, for they suppose that each of the stars is a world. Epicurus rejects none of these opinions, because he embraces anything that is possible." (Quoted from Martinez).
Diogenes Laertius, with his great compilation "Lives of Eminent Philosophers", quotes the following passage in his section on Epicurus:
"Moreover, there is an infinite number of worlds, some like this world, others unlike it. For the atoms being infinite in number, as has just been proved, are borne ever further in their course. For the atoms out of which a world might arise, or by which a world might be formed, have not all been expended on one world or a finite number of worlds, whether like or unlike this one. Hence there will be nothing to hinder an infinity of worlds. "
As far as I understand, Martinez did his own re-translation of the passage, which is a little easier to understand:
"But worlds also are infinite, whether similar to ours or dissimilar. Since the atoms are infinite in number, as demonstrated, they must move across immense distances. Also, such atoms, which constitute the world, from which it came, could not be entirely used up by a single world, nor by any limited number of worlds, whether we suppose them similar to our world, or different. Hence, not one fact is contrary to an infinity of worlds."
To summarize: in Greek Antiquity, the idea of many worlds and their inhabitants was fairly heavily discussed, with various theories put forth. Of course, there were others who argued against the idea - Pliny, Cicero - but since that's not our focus, let me come back to what happened to the idea next.
And what happened was the rising prominence of the Religions of the Book, which at the same time built on and denounced the heritage of antiquity. What's important here is that for both medieval Christianity and Islam Aristotle is of an importance that simply cannot be overstated, a basis for much philosophy and theology, and in many areas borrowed Aristotelian philosophy outright. Additionally, both Christianity and Islam leaned heavily into the idea of a singular, exceptional humanity, and thus of a singular, exceptional world crafted according to divine plan (aside: for medieval Islam, I would encourage someone who actually knows Arabic philosophy to respond, because I'm afraid I'm simply not competent to name names, but I'm fairly sure that something should come up). There are, of course, exceptions, such as Origen, who postulated the existence of various worlds in his De Princiipis, albeit not concurrently (he thought that universes succeeded each other, each one different, and people could be reborn in these new worlds). But by and large, the idea of many worlds and other sentient beings was very much Not Normal for many centuries.
Fast forward to early modernity and the rediscovery of antiquity. And then we get Giordano Bruno, the man who famously picked up all the weird ideas, made all the enemies, and the combination of those two factors got him burned at the stake (NB: it is IMPORTANT that it's the combination of these factors. There were a LOT of people with weird ideas, but most of them lived. Luther was excommunicated, though!). He picked up the idea and RAN with it, particularly in his 1584 treatise "On the Infinite Universe and Worlds". If you have the opportunity to read it, do so: it is very poetic!
A cursory search hasn't given me a quick link to the whole treatise, but I did find a very famous quote.
"Make then your forecasts, my lords Astrologers, with your slavish physicians, by means of those astrolabes with which you seek to discern the fantastic nine moving spheres; in these you finally imprison your own minds, so that you appear to me but as parrots in a cage, while I watch you dancing up and down, turning and hopping within those circles. We know that the Supreme Ruler cannot have a seat so narrow, so miserable a throne, so straight a tribunal, so scanty a court, so small and feeble a simulacrum that a phantasm can bring to birth, a dream shatter, a delusion restore, a chimera disperse, a calamity diminish, a misdeed abolish and a thought renew it again, so that indeed with a puff of air it were brimful and with a single gulp it were emptied. On the contrary we recognize a noble image, a marvellous conception, a supreme figure, an exalted shadow, an infinite representation of the represented infinity, a spectacle worthy of the excellence and supremacy of Him who transcendeth understanding, comprehension or grasp. Thus is the excellence of God magnified and the greatness of his kingdom made manifest; he is glorified not in one, but in countless suns; not in a single earth, a single world, but in a thousand thousand, I say in an infinity of worlds."
And from here we enter into modernity, and so I shall stop the tale here - unless you have follow-up questions, of course. I am sorry I don't know much about the non-European contexts, and I am certain that researchers in those areas would also have quite a bit to say!
Secondary literature:
Alberto A. Martinez (2016). Giordano Bruno and the heresy of many worlds, Annals of Science, 73:4, 345-374, DOI: 10.1080/00033790.2016.1193627
Steven J. Dick (1982). Plurality of Worlds: The Origins of the Extraterrestrial Life Debate from Democritus to Kant. Cambridge: Cambridge University Press.