。
I learned your name from a friend.
Literal
Friend [from-から] name [object-を] learned.
お名前 uses the honorific prefix お-, suggesting the speaker is addressing the person whose name was learned. 知りました ('came to know') is the polite past of 知る, marking the moment of learning rather than an ongoing state of knowledge.