姓氏 refers to surname, and 名字 refers to personal name.
But I’ve heard people using the separate characters to talk about surnames and personal names.
林氏集团 (Lin’s Corporation, like one of those companies named after their founder)
字: I’m not too sure about this one, but I know 李白’s 字 is 太白
What is the difference between all these?