Upvote:6
Toronto Pearson has preclearance facilities for the US. You will pass through US immigration before boarding your flight, and there will be no immigration at Atlanta. You'll pass through South African immigration at Jo'burg.
Delta should handle your baggage for you at Atlanta if the flights are booked on the same reference (they probably are). You'll need to claim and recheck your baggage at Jo'burg because that's your port of entry to South Africa and you'll need to clear customs there.
With no baggage or formalities at Atlanta, 3.5 hours will be plenty. Two hours at Jo'burg will be tight. If you're booked through on the same reference number then the airlines should re-book you if you are delayed. If your BA flight is booked on a different reference then you are responsible if your Delta flight is late. You might do well to allow more time at Jo'burg in either case.
You haven't given your nationality, but if you don't need visas for visiting, you won't need visas for transit. There is no such thing as a transit visa in the US, and at Jo'burg you're entering the country so it's not a transit.