Modules extend the functionality of Drupal in order to add new features as well as alter existing functionality.
The three types of modules are:
Core modules: These are included with Drupal core and are shipped with the standard drupal installation. They are in /core/modules/.
Contributed modules: These are modules built by the community. The are typically in /modules/contrib.
Custom modules: Custom modules written for your project. Typically in /modules/custom.