First you need to know about how people were named at that time. Back then one's name had three parts:
姓 (family name), 名 (given name), 字(also given name, but doesn't exist today)
孔 was his 姓, 丘 was his 名, and 仲尼 was his 字.
I don't need to explain the family name much. As for 名 and 字, the difference is that 字 is more formal than 名. And one often calls himself by 名 to show modesty and calls the one he is talking to or mentioning by 字 to show respect.
Finally, "子" is a suffix after the family name to mention someone who is well-respected (for example, a teacher, a well-educated person, etc., and Confucius was both and more).