Both mean "to confess" in English, but they have each a different use.
고백: to confess secrets, feelings, love, etc (emotional)
자백: to confess a crime. (factual)
You will come across this kind of distinctions quite often.
e. g.
추억: memory, emotional
기억: memory, factual