Some recent estimates suggest that it takes 100 million years for one carbon atom to cycle from the interior of the Earth to the atmosphere to the oceans and back to the interior.
It naturally gets ejected from the interior of the earth from volcanic activity.