There is no single definition. Each context, each technology can define it in a different way. So the dictionary definition can help more than a specific definition. It can be viewed at Priberam or Michaelis . So it would be something measured in a small and harmonious way?
There are modules that do not have these names. And there are things called modules that may not undergo a rigorous inspection of the term.
Note that there is not even a definition of the size of this module. He may have a very specific responsibility or a more general responsibility. While it is true that it does not correspond to the whole, it is a part of the whole.
Anyway, there is not a good canonical definition of what this is. You have to analyze the context to better define what you are talking about.
Modular programming
There is modular programming that proposes to create applications divided into small parts. What these parts are is not well defined. A module in this context can be a method, it can be a class, it can be a source file, it can be an executable, it can be a package, whatever that means in each situation, it may be some other grouping of other smaller parts still .
Static classes
In fact it has language that calls a module a class that only has static members.
Grouping of types and other constructions
It has language that groups several types (represented by classes, for example) within it. Some of these look like a namepace , others to a compilation unit, usually even blending the two concepts.
PHP
In PHP the term is used for things that are not of the programming itself.
Out of schedule
I did not even come close to talking about the modules used in anything in the professional developer cycle but it is not related to the programming itself.
Mathematics
I did not mention the module that is the operation of obtaining the rest of an entire division. I guess that's not the point of the question.