With increasing forms of malware, it was important to classify them. In 1991, the Computer Antivirus Research Organization (CARO) came up with a naming convention for malware.
The website http://www.caro.org/articles/naming.html gives directions on how security researchers should name a piece malware. Other than this, malware is sometimes named with the strings found in the malware file. The names of malware can vary from antivirus to antivirus, based on how they have detected it. Also, the naming convention may vary with different antivirus vendors.
Here is how Microsoft names malware: https://www.microsoft.com/en-us/wdsi/help/malware-naming.
VirusTotal is a website that hosts antivirus software. When one uploads a file to VirusTotal, the antivirus engines scan the file and display the results. The following screenshot shows detections from various pieces of antivirus software from www.virustotal.com for a particular malware:
Screenshot from virustotal.com
As shown in the screenshot, various antiviruses name the malware in different ways. Microsoft detects it as TrojanDownloader:JS/Nemucod, while others name it in different formats.