The question was asked before, but it lacks any in-depth answers.
Here are some information about how suicide was deemed a sin in early Christianity. Feel free to correct me if there is any mistake and ask if you have any question:
Timeline:
During the early years of Christianity, many believers chose suicide over the difficult life of religious persecution. In fact, some early Christian writers maintained that a self-chosen death was a goal for the genuinely pious to aspire. The number of Christian martyrs and mass suicides rose so quickly that the ruling Jewish faction decided to forbid eulogies and public mourning for those who died by their own hand (as you know, the persecution of Christians back then was horrifying). This action began the stigmatization of suicide in Judeo-Christian culture.
The first church-led condemnation of suicide occurred when Jewish leaders refused to allow the bodies of Christian suicide victims to be buried in hallowed ground.
The few Christian condemnations of suicide came from the notion that suicide was to be despised because it was the action of the betrayer of Jesus. Thus, suicide developed a “guilt by association" because of Judas' death by hanging.
In the fifth century, St. Augustine wrote the book The City of God, in it was the first overall condemnation of suicide. His biblical justification for this was the interpretation of the commandment, "thou shalt not kill", as he sees the omission of "thy neighbor", which is included in "thou shalt not bear false witness against thy neighbor", to mean that the killing of oneself is not allowed either.
Augustine's influence on church doctrine resulted in a series of conciliar developments. In 305AD, the Council of Guadix purged from the list of martyrs all who had died by their own hand. Using the pretext of piety, the 348AD Council of Carthage condemned those who had chosen self-death for personal reasons and the 363AD Council of Braga condemned and denied proper burial rites for all known suicides. Although meant as a preventative measure, Church condemnation festered the stigma introduced by Jewish authority years earlier.
The act of suicide became immersed in shame and fear, remaining so for the next nine decades. In the 13th century Thomas Aquinas fortified the Church's official position against suicide. Unlike Augustine, who acted to quell the surge of suicide among Christians, Aquinas was motivated by a need for intellectual understanding. Aquinas completed a comprehensive and systematic review of Christian theology, entitled Summa Theologise. In this work, Aquinas vilified suicide as an act against God (much like Socrates) and denounced suicide as a sin for which one could not repent. Aquinas' admonition resulted in civil and criminal laws to discourage suicide.