When do I have to use naru hodo, and when do I have to use wakarimashita? As far as I know, they both mean something like "I understand" or "I understood".
Both "naru hodo" and "wakarimashita" mean "I understand," but there is a difference in the usages and nuances between those two words.
"Naru hodo" means "That makes sense to me." and includes the feeling of admiration such as "Wow" or "Oh".
A: "Why is this jacket so expensive?"
B: "Because it is handmade and moreover it is '60 vintage."
A: "Naru hodo!"
On the other hand, "wakarimashita" means just "I got it." or "Will do." You can use this phrase when you are asked to do something from your boss.
A: "Could you make two copies of this document ?"
I like to think that Naruhodo is more like
"Oh, I see!"
You say it when you have just understood something that you did't understand until this moment.
Wakarimashita is simply "Ok" or "Understood". You say it when someone asks you to do some task, or when someone is explaining you something in a more formal situation.