The atmosphere gets thinner and thinner as you rise. Eventually it is so thin that you could call it 'space'. But you would still be within the Earth's gravitational influence and there would still be a whiff or two of atmosphere. Of course, the atmosphere would thin out to virtually nothing , but the gravitational pull would remain; that's what keeps the moon going round the Earth instead of flying off at a tangent, and that's what keeps the Earth 'stuck' to the sun; and that's what keeps our solar system together and out galaxy together.
I can't tell you how long it takes to get to space, because space doesn't have a specific distance or boundary.