First, customs, immigration (passport control) and security are three different things. In the US we often say "customs" to mean all three, but it's important to understand the difference and to use the correct terms to avoid confusion (particularly in other countries, where they use the terms correctly).
Second, while I understand wanting to know what's involved before you get to and through the airports, remember that you won't be allowed to skip any necessary steps. And, for various reasons, the exact steps and procedures can change. Be prepared to go with the flow.
You should check in for your flights on line or on the Delta App. Check in opens 24 hours before the flight, and you should get an e-mail notifying you (if you have the app, it will also notify you). Often these days, you can get the boarding passes on your phone, and/or can get them e-mailed to you as PDF's that you can print. But sometimes you have to wait to get to the airport to get your boarding passes; again, go with the flow on this. When you get your boarding passes, you should get both the one for ORD to ATL and the one for ATL to JNB.
At the airport, you will get your boarding passes (if you do not have them already) and check your luggage. It should be tagged JNB (make sure of this); as long as it is, you will not see your checked bags until you get to Johannesburg. For your carry-on bag, in addition to valuables and several days of clothes, make sure you have any rechargeable batteries (Delta is quite strict on not letting these in checked luggage, for risk of fire). You then go through security to your gate for your ATL-bound flight. Since this is a domestic flight, there is no customs or passport control at this stage.
In Atlanta, you get off your first flight and find your second one. If it's more than 1 or two concourses away, take the Plane Train (like a subway); if it's close you can walk just as fast. I don't think you will have to go through security in ATL, but I'm not sure. You will not go through customs or passport control (unlike most other countries, the US has no passport control on departure). However, the airline may want to see your passport, to make sure you have it (they get a HUGE fine if you are refused entry to another country - in addition to being responsible for flying you back to the US at their expense).
On arrival in JNB, you will go through passport control, then pick up any checked luggage, then go through customs. I haven't flown to South Africa, so I don't know more about their procedures.
On your return to the US, you will get both boarding passes in Johannesburg. If you are checking luggage, make sure it says ORD. You will go through security and passport control on the way to your flight. You will only deal with customs if you have something special, like a tax refund.
For all flights to the US, you go through immigration and customs at your first US airport, regardless of your final destination. So, on arrival in Atlanta, you will go through passport control, then pick up all checked luggage, then go through customs. This can be fast or slow, depending on how many other international flights are arriving and how many agents are on duty. After customs, there is a "baggage recheck" area; if you have checked luggage, deposit it here (the ORD tags will get it to the right flight, hopefully). You then go through security (since you've left the secure area) on the way to your next flight. You are now done with the "formalities," and your ATL to ORD flight is like any other domestic flight.
If for any reason you're lost or confused in an airport, don't hesitate to ask for help right away.