Just as there were requirements for a theme, there are requirements for a plugin. At the very least, your plugin must satisfy the following:
- It must be placed in the wp-content/plugins directory (inside the root directory of WordPress)
- It must have a PHP file with a unique name (that is, a name not used by any other plugin in the main wp-content/plugins directory)
- It must have a specially structured comment at the top of the file
(see https://codex.wordpress.org/File_Header for more information)
Then, of course, you must have some functions or processing code; but WordPress will recognize any file that meets these requirements as a plugin.
If your plugin is a simple one, then you can just place a unique PHP file straight in your wp-content/plugins directory, so it can sit next to the default Hello Dolly plugin that WordPress comes with. However, a much better practice is to create a subdirectory (again, with a unique name) and place your PHP file there. It makes the wp-content/plugins directory seem much more organized. Plus, you never know when your plugin is going to need some additional files (it's always easier to simply add new files to a previously existing plugin directory, than to restructure the plugin from scratch).