The setting is per file, and can be set via selecting the file and then cmd+I (or right-clicking on it and then Get Info).
This is an important distinction that I didn't realize when I replied yesterday. What I said could be true, but according to Apple, if you have "show all filename extensions" selected, it FORCES all extensions to show, even if an individual file is set to hide it's extension. On the other hand, if you DON'T have "show all filename extensions" selected, then only individual files that are set to show their extension will.
So since the OP does NOT have "show all filename extensions" selected, then either the files that he's seeing extensions on are individually set to show extensions, or the extension could be part of the filename itself and not an actual extension. He will need to cmd+I each file to find out.
In the Finder on your Mac, show filename extensions, if you find them useful. They’re usually hidden in macOS.
support.apple.com