Most of us have answered to different names at various points in our lives.
Why We Have Multiple Names
Take my nephew's name; Robert.
Robert is his formal legal name. A common nickname for Robert is Bob (I don't know why, but it is), and that is considered a casual name. Bob is name #2. Rob (a first syllable of his formal name) is also a nickname; so name #3; though in this case most named "Robert" will go with either Bob or Rob, not both.
However, growing up, many people use an affectionate diminutive form of a name by adding "-y" to it, if it sounds right: Bobby and Robby, names #4 and #5 derived from "Robert".
People can gather names by their role, "Dad, Father, Pop, Grandpa" or "Mom, Mother, Mama, Grandma". Name #6.
And finally, people acquire actual affectionate nicknames from their friends in childhood or young adulthood that have nothing to do with their real name, but often something they did, or some unique ability or trait. So a nickname can be name #7.
So somebody might be nicknamed "Runner," not because they were a speedster on the track, but because they are so good at billiards they can "run" a table (pocket all the balls without missing once). It's a rare skill.
Likewise, I knew a guy in college nicknamed "Chugger" because he could chug a beer faster than anybody else in his crowd, and this was considered an admirable talent.
People go by different names because most of us have segmented lives, or different groups of people where we belong, but the groups don't have much interaction with each other. And although we may not have different names in each of these groups, we might.
I have a professional academic life; but my colleagues there (other than one) don't know the name of any of my family and other friends.
I have a domestic life with a spouse and child and grandchild.
I have an extended family life with my siblings, inlaws and their children, call it my "Christmas Family".
I have a "friends" group with similar leisure interests; some people have multiple such groups, each with a specific interest, that do not interact much: A chess-playing group, a writing-group, a tech group, a church or charity group, a political group.
Again, most people use the same name again and again in all of these groups, but not always. In his professional life and political activity groups my nephew goes by "Robert," but at Christmas family gatherings and birthday parties and sports watching parties he will always be "Bobby".
Using Multiple Names in Writing
As you should gather, different names are used in different social circumstances, and can carry different levels of emotional significance or emotional detachment. For my nephew "Bobby" is reserved for the people he grew up with and raised him; it is a personal name reserved for his friends. Call him "Bobby" in his office, and he will correct you: "I prefer Robert."
Some beginning writers take all these names and try to use them for variety, because they think one name sounds too repetitive. Don't worry about that, readers don't care, and it just gets confusing if you are cycling through five names again and again. In narration, pick ONE name and stick with it, even if other characters are using different names.
Instead, use multiple names the way they evolve; in different disconnected (or weakly connected) social circles, and understand that the name a character uses to refer to "Robert" is an indicator of the social circle in which Robert knows them. This can make it clear to the reader, if you ensure only people that knew him in college call him "Runner". Only his mother and family relatives call him "Bobby" (maybe including his wife). Only his professional colleagues call him "Robert".
This will seem more natural to the reader. You can also use it to create minor conflict, a college buddy calling him "Runner" becomes an important client of his firm, where he wants to be called "Robert".
Robert rolled his eyes. "Okay, dude, you keep calling me Runner, I'll start calling you Chugger. You want that?"
Charles lit up. "That's awesome, dude! It's a deal! Gimme five!"
"No, Charlie! its not a deal! Jeezus!"