'My friend' is specific.
'A friend [of mine]' is non-specific.
If you say 'my friend', it implies that the listener or reader already knows who this friend is - maybe the speaker only has one friend, or they have only one friend in a given context or they've already said who this friend is. (The same as if you said 'My dad' or 'my boss' or 'my boyfriend/girlfriend' - we'd know who this person was).
When we say 'a friend of mine', it means 'one of my friends' i.e. just one of several. It's normal to use the phrase 'a friend of mine' the first time the person is mentioned, and thereafter just 'my friend'. For example:
'I went shopping with a friend of mine last week. We were just getting off the bus, when my friend suddenly said...'
If you began the story by saying 'I went shopping with my friend ..', it wouldn't be wrong, but it would be a little odd.