Christianity spread to North Africa relatively quickly during the Roman Empire according to Niall Finneran (whom I'll be using for most of this answer) in their The Archaeology of Christianity in North Africa. After arriving into the major urban centers like Carthage, Christianity quickly grafted onto the urban and educated elite of the African Roman holdings and became ingrained into the cultural and educational elite of the area, as evidenced by major figures such as Augustine of Hippo. Its penetration into the countryside took significantly longer, and indeed in the area of Tripolitania, it likely never was fully completed. Continued pagan allegiance in these areas is attested by funerary inscriptions devoted to deities as varies as the Egyptian God Amun, the Punic deities such as Baal and Melkart, and Saturn (who was a syncretic figure identified with Baal). Finneran argues that these Christian communities survived the political turmoil of Late Antiquity, with heresies such as Donatism springing up that led to religious conflict in the area, and repeated invasions first by the Vandals, a group of people who were Christian but heretical, the Romans at least three times, and then the Arabs in the 7th century. The final Christian communities of the area Finneran estimates as being in operation until the 16th century. The majority of the population converted to Islam probably by around the 10th century if not a little later.
Now how did Christianity get to Africa? There were major hubs of Christians in the empire, but they were largely distant from the African cities (though Carthage would soon join them) Greece, Egypt, Rome itself, and the Levant were where Christianity first spread, largely because of the presence of Greek speaking Jewish communities that were among the first communities to convert to the new religion. Converts among the gentiles did eventually spring up in those same areas as well. Now Christianity actually reached there by a series of diffusions but largely it moved along the trade routes that connected the urban centers of the empire. Cities like Rome, Antioch, Alexandria, Carthage, and more were all connected by trade routes that created an extremely mixed and diverse population. These trade routes and internal movements of people were how Christianity moved between the major cities.
Conversions among the urban population were relatively rapid, and western North Africa was the site of extensive and well supported church building by the inhabitants. Now this resulted in the expansion of the Christian population of course, but there was a great deal of diversity over time. The African Church was closely tied with the Roman Church prior to the Byzantine invasions in the 6th century, but this was not always a peaceful relationship. Roman Africa was the site of a major heretical movement known as the Donatists, who protested, according to the Donatists, the apostasy of major religious figures in Africa during the persecutions by the Roman state. Donatists believed that the figures who had collaborated with the Roman authorities and handed over their scriptures to the Roman authorities were no longer able to validly carry out the sacraments of the Church. The Church in Rome, and the figures who were returning to the fold after the persecutions ended, condemned the movement as heretical and for centuries there were religious tensions between the Christian communities. The Donatists were never entirely stamped out by Roman authorities.
Following the (re)conquest of North Africa by the Byzantines/Romans under Belisarius the Church in Africa became less associated with Rome and began to drift more towards Constantinople and the Imperial Church of the Byzantine Empire. However this process was cut short by the Arab invasions in the 7th century.
Following the Arab invasions of North Africa the situation of Christians in the maghreb became significantly more complicated, and the literary sources start to dry up. Many churches were converted to mosques and the population started to convert to Islam, depending on the area this took anywhere from centuries to almost a millennium. However the actual events and life of the Church in Africa became obscured by the imposition of Islam. For example, in his The Church in the Shadow of the Mosque Sidney Griffith spends chapters on the Levant, Egypt, Iraq, and the rest of the near East, but nothing on Africa. We know that Christianity survived for a time, but that's about it. There are later records of Christian populations helping European Christians in their wars against the Islamic powers of North Africa, but these are far flung, and by the 16th century the population of North Africa was overwhelmingly Islamic. What the nature of these African Christians was in unclear, did they continue to look to Rome or Constantinople, also unclear....