In ancient(古代的) China, people have three names: their family name, given name, and courtesy name(字). For example, we know Li Bai is a famous poet(诗人). His family name is Li, his given name is Bai, and his courtesy name is Taibai.
People use their given names when they are with their family or friends. And grandparents and parents call kids their given name at home. But when people work, they use their courtesy names.
Men get their courtesy names when they are 20 years old. Women get their courtesy names after they get married(结婚).
People's courtesy names have something to do with(与...有关) their given names. For example, Zhuge Liang(诸葛亮)'s given name is Liang. It means(意思是) "bright(明亮的)". His courtesy name is Kongming. And the meaning is "very bright".