Was Jesus a carpenter or a rabbi? One person told me that since disciples called Jesus rabbi and since he taught in synagogues he couldn't have been a carpenter as only rabbis were allowed to teach in synagogues.

Has this matter ever been covered in Christianity? If yes, can anyone, please, give an overview on this matter?

Could Jesus have been both carpenter and a rabbi? How did a person become  qualified rabbi in those times?
The question "Was Jesus a Rabbi" is covered here.  Short version: Yes, He was.

The question "Was Jesus a carpenter" is covered here.  Short version, "yes, but in typical fashion people dispute the exact meaning of the word, which could also be translated as craftsman."  In this case, whether carpenter could mean craftsman or stonemason or whatever other occupation doesn't matter.  You're asking how he could have been a carpenter and a Rabbi.

Not to point out the obvious, but it was a career change.  In His early days, He was a carpenter. Later, He began His true calling - His earthly ministry.

There is no discrepancy in Scripture referring to Him as a carpenter in one place, and as a Rabbi in another.  Were someone to write about my life (what a boring book that would be) they could just as easily refer to me as a Restaurant Manager and a Software Developer, a Father, Husband, Satellite dish salesman, etc.

To answer the remaining point in your question, the first link above also covers how "one became a Rabbi in those times".