So from where and when did Lent arise?

Etymology
Old English lencten “springtime, spring,” the season, also “the fast of Lent,” from West Germanic *langitinaz “long-days,” or “lengthening of the day” (source also of Old Saxon lentin, Middle Dutch lenten, Old High German lengizin manoth).
This prehistoric compound probably refers to increasing daylight in spring and is reconstructed to be from *langaz “long” (source of long (adj.)) + *tina- “day” (compare Gothic sin-teins “daily”), which is cognate with Old Church Slavonic dini, Lithuanian diena, Latin dies “day” (from PIE root *dyeu- “to shine”).
The Pagan origins of Lent Etymology online.
Spiritually speaking, all roads lead to Babylon and such is the case in regard to the forty day spring fasts.
Ash Wednesday
The sign of the cross rubbed with ashes is not exclusive to Christianity; it is found throughout the ancient world and was used as prominent symbol of the pagan Gods. For example, “the Tau cross was inscribed on the foreheads of initiates into the Mysteries of Mithras.” It is also note worthy that the act of simply sprinkling ashes directly on the head, which is also done on Ash Wednesday, was done in honor of the pagan Norse god Odin as well. The placing of ashes above the brow always occurred on Wednesday, the day named in honor of Odin.
Lent

Unknown artist • Public domain
In one version of the Babylonian myth, Tammuz the great hunter was slain while hunting a wild boar. Devotees mourned for him through weeping ceremonies for forty days. Worshippers of Tammuz wept with his consort Ishtar believing that his rebirth would mean the regeneration of life within nature. Similar feasts are found throughout pagan peoples of antiquity.
During the days of Ezekiel this ritual was even found among the Israelites. Ezekiel writes:
“He said also to me, “You will see still greater abominations that they are committing.” Then he brought me to the entrance of the north gate of the house of the Lord; women were sitting there weeping for Tammuz..” (Ezekiel 8:13-14)
Oremus Bible Browser NRSV
Thus the Lenten fast and its rituals are not rooted in Christ but in the pre-Christian Pagan worship of antiquity. See above.
Okay
When?
The earliest Christians did not celebrate any of the Feasts we associate with the Life of Christ, his life was fresh in their memory or their parents memory. Jesus was expected to return, very soon, so why bother to write anything down or create any special memories of him? The Breaking of the Bread occurred whenever they met for Prayer times, it was Paul,as recorded by Pliny who was the first to formulate a Liturgy and to deal with questions of life and death regarding the return of Christ and those who had died before his birth.
At some point the church hierarchy decided that an organised Liturgy and practice was necessary to align the lives of the people with the life of Christ. Bishop Irenaeus of Lyons (c.130-c.200) wrote of such a season called Lent , but back then it lasted only two or three days, not the 40 observed today. See Irenaeus of Lyons, early Christian Writings.
Constantine 1 called approximately 1800 Bishops to Nicaea to represent the whole world, about 300 Christian bishops,from the eastern half of the Roman Empire, attended (with their retinue of priests and and deacons). The ecumenical council of Nicaea, began on July the 4th 325,
The main agenda was to deal with heresy, to settle the Nature of Christ as to be attested in the Creed. Among other things the Council instigated a 40-day Lenten season of fasting, but it is unclear whether the entire church were to participate or just those preparing for Baptism however it soon encompassed the whole Church.
Now Who decided that certain beliefs about the Nature of Christ, (The councils we are told) that there is a Trinity,that certain beliefs were vital for our salvation, despite the fact that Jesus called many so called Heretics to follow and serve him? Who was in and who was out depended upon the different interpretations of the Logos and these interpretations drew blood. As they continue to do so today, one person against the other, denomination against denomination such that the bone of contention is forgotten about as I prove that I am right and you are wrong. SO!!!?? As if Jesus didn’t know his own mind.
I prefer my “God who walks the earth” who told his little friend to stay away from Doctrine or Paul’s GSHJ with such a sense of humour. So while all this history concerning our liturgies, the way we choose to remember Jesus, is interesting.More things to fight over.
Listen to Jesus, don’t worry about who men say he is, who is he to you? How far are you from Babylon? Far enough away to learn to love the Lover.