Internally, there is nothing in a Gerber file to indicate its purpose or function. It is simply a set of commands telling how to "draw a picture". Once the picture is drawn and placed before a human person, it's function may be obvious but usually there is external information to tell you what the picture is supposed to represent. Open a Gerber file - any Gerber file - in a good text editor (I like "Notepad++") and you'll see what I mean.
So Gerber filenames are completely insensitive to the both the basic name, and the extension. Traditionally, when you submitted Gerber files to a board fabricator you included a "Readme.txt" file that identified the function of each Gerber file. In more recent times, board fabricators have specified particular naming conventions. There must be at least half a dozen "conventions" for using the 3-letter extension to indicate the purpose of the Gerber file, depending on what layout program created the file or which vendor will fabricate the board. E.g., the Gerber file for the top silkscreen layer might be called "Awesome_Circuit_Gerber.slk", or "Awesome_Circuit_Gerber.tss", or "Awesome_Circuit_Gerber.tsk", etc.
(And many of us superannuated old guys will include a text string on the layer itself - e.g., "Top Silkscreen" - placed near to, but outside the actual board perimeter. As a last resort, you hope that a sharp-eyed CAM Operator will see this string on his display and correct any inconsistency before the board is actually fabricated.)