For example, if you download a JPEG (.jpg) file, the downloaded file might be named "filename.jpg.html" instead of "filename.jpg".
If the filename extension added by Safari is not accurate, delete the extension from the file name and the file should open in the correct application. If it does not, use Get Info in the Finder to force the file to open with a certain application, such as described here.
Safari might add these extensions based on information received from the website about the file type. If file type sent by the server does not match the extension, Safari may append an extension to ensure the file is recognized by the Finder.