You can remember the meaning of 名字 with this easy mnemonic:
I don't remember his name (名), not even a single letter (字)…
Using mnemonics to remember the meaning of Chinese characters like can have an enormous impact on how long to learn Mandarin it takes.