The phrase »Benutzername(n) kopieren« is an ellipsis, i.e. a fragment of a sentence. The whole sentence might be something like this:
Ich möchte den Benutzername(n) kopieren.
Now we have a complete sentence, and only now we can analyze it, because grammar is the science of arranging and modifying words to create sentences. Grammar is not the science of creating fragments.
The sovereign of each sentence is the verb. Here we have a modal verb (»möchte«) which is something like the kings assistant, and a full verb (»kopieren«) which is the king. And this specific king wants to have its object in accusative case.
This accusative object is the part »den Benutzername(n)«. It consists of an article (which we don't care about here) and a compound noun.
The compound noun »Benutzername« is created from »Benutzer« and »Name«, and, as for all compound nouns, its grammatical behavior is dictated by the very last element only. So, we have to look only at the word »Name«.
Now, let's look at the declension table of this noun. There are many resources where you can find such tables, one of them is Wiktionary.
And for accusative case singular we have only one option:
den Namen
So, the only correct version is:
Benutzernamen kopieren
Period. That's it. End of Answer.
But wait! Who makes these rules? And who says they are always valid and have no exceptions?
There is nothing like a Committee for German Grammar, that makes and defines German grammar rules. It's the native speakers themselves who define these rules just by using the language the way they do. Authors of grammar textbooks just try to analyze a lot of sentences produced by a lot of different native speakers, and then they write down their findings. They do not make the rules.
So, maybe the native speakers unknowingly decided to have an exception for very specific cases without any author of textbooks realizing it. But how can we find such exceptions? Nobody wrote them down in books. So, we have to find them on our own.
My attempt to solve this and similar problems is to ask Google or any other search engine.1 This is not really accurate, but gives you a rough estimation:
- search for "Benutzernamen kopieren" (including quotation signs)
Ungefähr 893 Ergebnisse
- search for "Benutzername kopieren" (including quotation signs)
Ungefähr 559 Ergebnisse
893 is more than 559.
But these numbers become more precise (and always much smaller) when you navigate to the last page:
- "Benutzernamen kopieren"
Seite 14 von ungefähr 135 Ergebnissen
- "Benutzername kopieren"
Seite 10 von 100 Ergebnissen
Both numbers became much smaller, but still: 135 > 100. So, "Benutzernamen kopieren" is still more frequently used than "Benutzername kopieren". And this is why I still recommend the version with an ending -n.
But, these numbers also show: Maybe in the very specific context of exactly these two words, there is a conspicuous minority that speaks pro "Benutzername kopieren". So, if you feel better without the accusative ending, it will be accepted too.
1 Also Google's ngram viewer is a good resource, but it has not enough data for this specific question. And it analyzes only texts printed in books.