Santa Marta is a city in Colombia.
Northeast towards Riohacha
Walk out towards the fork in the road at a newly constructed roundabout, and traffic lights (3 km or so) on Calle 29. Cars can be flagged from here, though this took time.
It may be better to hop on a bus headed to Bonda, a local service, and get off when it takes a right fork in the road, 5km out of town. There are speed bumps around this area.
South towards Barranquilla
It's hard to get out towards Barranquilla because the road is filled with regional traffic from all the villages on the way towards the airport and there is no good place like a gas station. You could try your luck at the big roundabout "La Lucha" where sometimes people stop for a snack. On the road it's more difficult because all the motos and busses will stop for you. Instead anywhere on the road you could catch a blue bus for 1.800 COP to the airport and ask them to leave you at the entrance of one of the big companies where loaded trucks leave (“donde salen las mulas”). But if you can catch a white bus for 3.500 COP directly to Cienaga which is already behind the crossing where the road splits to Santander, so there all traffic goes to Barranquilla. In Cienaga ask the driver to leave you at the gas station on the main road. Anywhere on the main road trucks and cars stop for snacks and there are also several speed bumps after which you could wait.
The main road enters from the north area of town, so if you are headed north, you can avoid entering the city.
Other useful info
If you area heading to Tayrona NP, it is quite easy to sneak in to this NP. Alternatively, continue about 5km further north from the entrance, and there is a beach access road, which leads to a beach where wild camping is wonderful and easy, on a stunning beach. Playa Los Angeles. Quite easy to get out of a 10,000 Peso access fee they try to charge.