Individually, for our life spans. As a species, presumably until the death of the sun. (some 7 billion years away). Unless we do something incredibly stupid, like start chucking nukes around, or otherwise destroy the ecosphere on which we depend for our sustenance.
This was your response to the question...."And how long were they [we humans] to live on the earth?" But from a biblical perspective, you didn't answer it. If you consult Genesis you will see exactly how long humans were supposed to live on this earth....
The two trees specifically mentioned in the garden were opposites....the partaking of one fruit would lead to everlasting life (in mortal flesh) and the other would take life away.....permanently. That was the benefit of not being created "immortal" because immortals cannot die. Creating intelligent beings with free will would have been a nightmare if God could not eliminate them if they chose to disobey him. Hell was a concept created to give the impression that souls were immortal, but they aren't so "hell" must mean something else. What do you think "sheol" (Hades in Greek) meant to the Jews?
Since the Bible does not teach that we have an immortal soul, the concept of hell is not biblical. "Souls" are mortal (Ezekiel 18:4) and since the word in Hebrew simply means a "breather", we can see in Genesis 2:7, that Adam was not "given" a soul but "became" one when God started him breathing. Animals are also called souls in the creation account.
Solomon wrote about the futility of man's superiority over the animals if we all ended up in the same place...?
"for there is an outcome for humans and an outcome for animals; they all have the same outcome. As the one dies, so the other dies; and they all have but one spirit. So man has no superiority over animals, for everything is futile. 20 All are going to the same place. They all come from the dust, and they all are returning to the dust." (Ecclesiastes 3:19-20)
This is what Adam was told too.....
"In the sweat of your face you will eat bread until you return to the ground, for out of it you were taken. For dust you are and to dust you will return.” (Genesis 3:19)
No 'heaven or hell' is mentioned there, and no 'heaven or hell' was taught in any of the Hebrew scriptures. So where did the concept come from.....?
Who was it who said...
"you surely will not die"?....it wasn't God.
There was significance in the eating of "bread" because that had never been part of man's diet up to that point.....an abundance of various fruit trees were what they had free access to, so to till the soil on cursed ground in order to make bread, was diametrically opposite to what they had in the garden. Life was no longer going to be a piece of cake...or fruit....
So judging by the presence of "the tree of life" and God's declaration before he evicted the the rebels from the garden...
"Jehovah God then said: “Here the man has become like one of us in knowing good and bad. Now in order that he may not put his hand out and take fruit also from the tree of life and eat and live forever,—” 23 With that Jehovah God expelled him from the garden of Eʹden to cultivate the ground from which he had been taken. 24 So he drove the man out, and he posted at the east of the garden of Eʹden the cherubs and the flaming blade of a sword that was turning continuously to guard the way to the tree of life."....
Man was apparently meant to live forever on earth in his mortal flesh. There was no promise of heaven, or threat of hell, just "obey and live....or disobey and die". That's it. Everything humans and all other living things needed to sustain their lives indefinitely, was provided in abundance. But in order to go on enjoying the pleasures of the garden, the humans had to stay away from "the tree of the knowledge of good and evil"....that knowledge was placed in God's exclusive jurisdiction. It was the only thing that was withheld from them. A small test of their respect for God's authority and Sovereignty.
The original Paradise was here on earth, and it was man's job to have children and to spread the boundaries of their paradise home until the whole world looked like the garden of Eden....imagine if they had simply done as they were told....?