Atma does not divide or individualize. Atma is what Brahman is called when Brahman is associated with Jiva.
You have asked the following questions:
If the atman is a permanent aspect of reality, how does it become attached to new bodies / lifeforms that are born?
Where/what was it before they were born?
The answer would ideally address the numbers problem, how there are more and more bodies emerging through time as species breed. More and more consciousnesses.
I can imagine how it is permanent after it is produced, but out of what does it come?
Your main question (questions 2, 3 and 4) is where are the new consciousnesses coming given that more and more bodies of Jivas are being born on earth? We will need to understand Brahman in order to answer the main question since Atma is simply Brahman when attached to Jivas or creatures.
So what is Brahman?
No one Knows the true nature of Brahman
Príthiví (Earth).--Hail to thee, who art all creatures; to thee, the
holder of the mace and shell: elevate me now from this place, as thou
hast upraised me in days of old. From thee have I proceeded; of thee
do I consist; as do the skies, and all other existing things. Hail to
thee, spirit of the supreme spirit; to thee, soul of soul; to thee,
who art discrete and indiscrete matter; who art one with the elements
and with time. Thou art the creator of all things, their preserver,
and their destroyer, in the forms, oh lord, of Brahmá, Vishńu, and
Rudra, at the seasons of creation, duration, and dissolution. When
thou hast devoured all things, thou reposest on the ocean that sweeps
over the world, meditated upon, oh Govinda, by the wise. No one
knoweth thy true nature, and the gods adore thee only in the forms it
hath pleased thee to assume. They who are desirous of final
liberation, worship thee as the supreme Brahmá; and who that adores
not Vásudeva, shall obtain emancipation? Whatever may be apprehended
by the mind, whatever may be perceived by the senses, whatever may he
discerned by the intellect, all is but a form of thee. I am of thee,
upheld by thee; thou art my creator, and to thee I fly for refuge:
hence, in this universe, Mádhaví (the bride of Mádhava or Vishńu) is
my designation. Triumph to the essence of all wisdom, to the
unchangeable, the imperishable: triumph to the eternal; to the
indiscrete, to the essence of discrete things: to him who is both
cause and effect; who is the universe; the sinless lord of sacrifice
4; triumph. Thou art sacrifice; thou art the oblation; thou art the
mystic Omkára; thou art the sacrificial fires; thou art the Vedas, and
their dependent sciences; thou art, Hari, the object of all worship 5.
The sun, the stars, the planets, the whole world; all that is
formless, or that has form; all that is visible, or invisible; all,
Purushottama, that I have said, or left unsaid; all this, Supreme,
thou art. Hail to thee, again and again! hail! all hail!
Vishnu Purana I.4
Universe and gods and goddesses are manifestations of Brahman
There are two states of this Brahma; one with, and one without shape;
one perishable, and one imperishable; which are inherent in all
beings. The imperishable is the supreme being; the perishable is all
the world. The blaze of fire burning on one spot diffuses light and
heat around; so the world is nothing more than the manifested energy
of the supreme Brahma: and inasmuch, Maitreya, as the light and heat
are stronger or feebler as we are near to the fire, or far off from
it, so the energy of the supreme is more or less intense in the beings
that are less or more remote from him. Brahma, Vishńu, and Śiva are
the most powerful energies of god; next to them are the inferior
deities, then the attendant spirits, then men, then animals, birds,
insects, vegetables; each becoming more and more feeble as they are
farther from their primitive source. In this way, illustrious Brahman,
this whole world, although in essence imperishable and eternal,
appears and disappears, as if it was subject to birth and death. The
supreme condition of Brahma, which is meditated by the Yogis in the
commencement of their abstraction, as invested with form, is Vishńu,
composed of all the divine energies, and the essence of Brahma, with
whom the mystic union that is sought, and which is accompanied by
suitable elements, is effected 7 by the devotee whose whole mind is
addressed to that object. This Hari, who is the most immediate of all
the energies of Brahma, is his embodied shape, composed entirely of
his essence; and in him therefore is the whole world interwoven; and
from him, and in him, is the universe; and he, the supreme lord of
all, comprising all that is perishable and imperishable, bears upon
him all material and spiritual existence, identified in nature with
his ornaments and weapons.
Vishnu Purana I.22.55-65
All of the individualized consciousnesses are simply Brahman explained above. Brahman is called anantam or infinite and all Atmas may be thought of as little sparks of this infinite consciousness. This is the answer to the numbers question (Q 2,3 and 4).
Answer to Q1
Yogic physiology of the Jiva needs to be understood in order to answer this question.
Yoga physiology says that the human body and personality are contained in 5 sheaths or koshas:
• Annamaya kosha
• Pranamaya Kosha
• Manomaya Kosha
• Vignanamaya Kosha
• Anandamaya Kosha
Of these koshas, Annamaya Kosha is the gross body. The word anna means food and the name suggests that our physical body is sustained by food.
The next three koshas make up the subtle body (linga sarira or sukshma sarira).
The word prana means life and is the vital energy that permeates all existence. Our physical life is sustained by prana. We die when this prana leaves the body. This pranamaya sheath or kosha is more subtle than annamaya kosha but more gross than the other three sheaths.
The word manomaya means mental. This manomaya sheath is the mental sheath. This is where part of our mind resides. This is more subtle than annamaya and pranamaya koshas but more gross than the remaining two.
The word vijnanamaya means intellect and is the intellectual or discriminating sheath. It is the seat for rational thought and is mistaken by most people as the ‘self’.
The last Anandamaya Kosha is the causal body. The word ananda means bliss. This last sheath is blissful because it is very close to the blissful Atman. You may be wondering why this sheath is also called the causal sheath. The reason is that the record of all our karmas is kept in this sheath and since our karmas lead to rebirth this sheath may be thought of as causing rebirth.
At the center of these 5 koshas lie the Atman.
The practice of Yoga in practical terms leads to digging through these 5 barriers and finally reaching the Atman.
A detailed description of these sheaths is in Taittiriya Upanishad II.1.1, II.2.1, II.3.1, II.4.1 and II.5.1.
Now that we understand Yoga physiology, we can answer your question. After death a person only has the subtle and causal bodies and the Atman. The Atman is always a witness whether in the earth plane or in the afterlife. A Jiva always has the Atman attached to him.
Advice: You need to supplement your reading of the Gita by reading the Upanishads to fully understand the Gita. I also suggest that you read the Gita translated by Swami Tapasyananda to understand the subtle points.
Additional material
It has been suggested in a comment that you are also asking whether new Atmas are created. I am adding this material in case you are asking this. The answer is that there is no first karma and hence no new Atma. There is no first karma. No one set in motion the law of karma since the transmigratory state has no beginning.
If it be argued that it is not possible (to take Karma - merit and
demerit - into consideration in the beginning), since the fruits of
work remain still undifferentiated, then we say, no, since the
transmigratory state has no beginning.
Brahma Sutra II.i.35
...the transmigratory state has no beginning. .... if that state has
no beginning, there is nothing contradictory for the fruits of work
and the variety in creation to act as cause and effect of each other
on the analogy of the seed and the sprout.
How again is it known that this transmigratory state has no beginning?
To this the answer is:
Brahma Sutra Bhasya of Sri Sankaracharya II.i.35
Moreover, this is logical, and (so) it is met with (in the
scriptures).
Brahma Sutra II.i.36
And it is logical for the transmigratory existence to have no
beginning; for had it emerged capriciously all of a sudden, then there
would have been the predicament of freed souls also being reborn here,
as also the contingency of results accruing from non-existing causes,
for the differences in happiness and misery would have no logical
explanation. It has been pointed out already that God is not the cause
of inequality, nor is ignorance by itself a source of this, it being
homogeneous. Ignorance can at best become creator of inequality in
consequence of the fruits of work, which are acquired as a result of
the influence of past impressions of the three infatuations - love,
hatred, and delusion. The fallacy of mutual dependence does not arise
from the impossibility of bodies being created without karma and karma
being performed without bodies; for if creation is beginningless, all
this become reasonable on the analogy of the seed and the sprout, and
hence there will be no defect.
And we realize the beginningless of creation from the Vedas and the
Smritis. In the Vedas, for instance, occurs the text, "Myself entering
into this as the embodied soul (Jiva-atma - living being)" (Chandogya
Upanishad Vi.iii.2). Referring to the beginning of creation, this text
speaks of the embodied soul as the "living being" on account of its
sustaining life, and thereby it shows that creation had no beginning;
for if creation had a beginning then, since the soul had no life to
sustain (at that time), why should the "living being" have been
referred to in that text through the word jiva (living one) which
comes into use from the fact of supporting the life process (jivana)?
It cannot be that the term jiva is used in anticipation that it will
support life in future; for an existing relationship is stronger than
future one, inasmuch as the former is an accomplished fact. And the
mantra text, "The Ordainer created the sun and moon like those of the
previous cycles (Rig Veda X.cxc.3) shows the existence of earlier
cycles of creation. In the Smriti also the transmigratory state is
noticed to be without beginning, as in "Its form is not here perceived
as such, neither its end, nor its origin, nor its continuance" (Gita
XV.3). The conclusion made in the Puranas also is that the past and
future cycles of creation are numberless.
Brahma Sutra Bhasya of Sri Sankaracharya II.i.36
A possible interpretation of the above commentary
In the first paragraph of Sri Sankaracharya's commentary he is arguing that first creation will violate the principle of regularity. Any irregular event like first creation will make any logical explanation of happiness and misery impossible.
In the second paragraph he is quoting from various scriptures to support his position. The quotes given by Sankaracharya supporting eternality of jivas are Chandogya Upanishad vi.iii.2, Rig Veda X.cxc.3 and Gita XV.3.