When can 叫 be used saying that someone is calling someone and when for asking a name?
Your intuition is correct. 叫 can be used in both ways (and even more). Here are the most frequent ones.

1) to call, to summon (using someone's voice). Verb is transitive:


  我爸爸妈妈叫我 
  Mom and dad call me (they are calling my name)


2) stating one's name. Verb + proper noun or definition:


  你叫什么名字？我叫张三！
  What's your name? My name is John Doe!


3) to yell, to shout, or more specific verbs when referring to animals, e.g. to bark. This is a colloquial usage. Verb is intransitive:


  我狗在叫！
  My dog is barking


4) giving orders, asking to do something. Colloquial usage. Accepts a verb phrase:


  我的驾照过期了，我要叫他开车！
  My driver's license has expired. I'll ask him to drive!



Specifically, how to decide between the usage 1 and 2. It is often made clear by the context of the whole sentence, as customary with the Chinese language.
As a rule of thumb, you'll have 叫 (to call) when it is followed by a regular object phrase, and you'll have 叫 (asking names) when it is followed by a proper noun or generically by a definition.