You don't have to buy a ship to leave
Besides going to a Starport (Besinte, Mos Eisley, Mos Espa I think, and 1 other has a starpor) where you can buy a ticket for an inter-system shuttle - you can also get a newbie fighter from one of the trainers.
I think there may be better information on here for that - say go to quests, Tatooine, and look for Pilot Trainer...
Anyhow, I know that the Neutral (Smuggler Alliance) Trainer is in the back room of the cantina in Mos Eisley. Go talk to him, tell him you want to train, he'll ask if you have a ship - if you don't, there is only one answer as I recall, and he gives you one. He'll also give you a mission, but you don't have to complete it if you just want to travel.
Additionally, if you did the Intro missions on Tansarii Station, and did the space quests, you already have the newbie ship.
When you have a ship, go to the terminal inside the Starport that is somethig like Ship terminal or something like that - NOT THE TICKET TERMINAL. These are usually in the first big room you enter when entering the Starport from outside.
You select a ship (if you only have one, you only have that one to select,) and then select the Travel Button. This will open up the Galactic Map menu for you to select a planet and starport to travel to.
That's the basics of it.
Additionally, if you've purchased the full game with Jump to Lightspeed, you should also have a Deed for a Luxury Yacht. This is a personal ship - kind of like a house that can also store things. You generate the ship from the deed, and it will be available for you to use from the Starport's Ship terminals. It's not a combat ship, so not very useful for missions, though you must launch it in order to access it like a house. But, you can use it for Starport to Starport travel from the terminals, as I already explained how to do above.
One last thing, if you do not have Jump to Lightspeed - you might not be able to use ships. I'm not sure, may be wrong, but this was the add-on that brought the space componant to the game. You can still use the Starport shuttle to travel to other planets.
THE Cor