@Switch BlaydeI'm struggling greatly with this right now, so it's very much on my radar. One of my characters has two names, one of which may - it's unclear as of where the story is publishing-wise now, and will remain unclear - be an affectation (one is a shortening of the other - they are clearly related, not two completely different names). Which should be preferred is unclear. That's especially true since the character themself is unclear about which is the preferred name, with the occasional passive and not entirely helpful comment about which is better and why - even when asked.
I'm generally leaning into the shorter version because, as the character will say in material yet to be published, the other name is a lot of name. But it clearly matters to them, and might matter far more than they're willing to own up to at any given point.
That's maybe a different question, but it's an interesting problem to have created for myself. One I'm glad I have, though. Much better for this character than simply picking a simple name and sticking with it.
In your case, it depends on the character. If your character himself says something like 'Call me Matt', or seems to be fine with being 'Matt', the tags become Matt, I think. Maybe toss in a side observation 'Apparently, Matt was his common nickname' or the like, if it's first-person, so the narrator makes the name choice explicit. If the character says 'It's Matthew', but people keep calling him Matt, tags and non-dialogue would be 'Matthew'.
In other words: what does the character want to be called, and what will they be called going forward? That fits what the narrator should say most of the time.
That works if the narrator knows. In my case, the narrator is (openly, in side comments about the situation) unsure which to go with, so sometimes bounces back and forth (partly in an attempt to not pigeonhole the character as either name). But, in my case, the narrator themself makes the issue more explicit. That makes it plot, which is much more fun.
And I forgot one, which Vincent Berg reminded me of when I looked at a later comment before hitting post. Two of my major characters are 'Angie' and 'Jasmine'. Both of them are referred to fairly often by those close to them as 'Ang' (cutting the word off, not changing the G sound) and 'Jas' (Jazz, again just cutting the word off). They're not the only two, but they're front-and-center in the great majority of chapters; 'Jess/Jessica' (the next most common) is much less so. Those pingpong in non-dialog because it's so common for them to be referred to either way. On the other hand, I have a 'Mel' who is actually a 'Melanie', and 'Melanie' never appears unless it's a specific formal setting or someone is confused as to who 'Mel' might be.
In every case, it's mostly a sign of relationships. People who are close to Angie, Jasmine, or Jessica would feel free to use the short name and often would, but only people who are close to them would do that. Mel, on the other hand, would prefer to always be Mel, except perhaps in formal situations.