It only takes a few minutes to get to space! Rockets hit the boundary of space, approximately 100 km above Earth, in around 8-10 minutes. It takes at most a couple of hours to get to the ISS in orbit.
The main reason for the variation is that Earth and Mars travel around the Sun at different speeds and distances. Travelling to Mars is no small feat. It's one of humanity's most ambitious space goals ...