Normally (.tpl.php) template files reside in the theme folder.
But sometimes custom modules may need to override the default template files -- page, node, etc. -- provided by Drupal. It can be tricky figuring out how to do this, so this page will present approaches for Drupal 5, 6, and 7.
Why would you want to override a template file in a module rather than in the theme?
There are a number of reasons a module would need to have control of how a piece of content is presented. A module may provide a new content type with a custom node template. In the case of the Print module, it is necessary to exclude the header, footer, and sidebars and then add some other elements.
The Drupal 6 and 7 approaches are similar: telling the theme system to look in the module directory for templates as well as the theme directory. In both cases it may be necessary to limit when the custom template is used. I.e., if a module has its own page.tpl.php, it probably should not be used for every page on the site.
This can be done by naming the custom template in such a way that it will only be used in certain cases. (See Drupal 6 template suggestions and Drupal 7 template suggestions.)
For finer control it can also be done using a preprocess function.