How can I add a Twig template to a programatically created custom content type?
Nodes
  
  Pattern: node--[type|nodeid]--[viewmode].html.twig
  
  Base template: node.html.twig (base location:
  core/modules/node/templates/node.html.twig)
  
  Theme hook suggestions are made based on these factors, listed from
  the most specific template to the least. Drupal will use the most
  specific template it finds:
  
  
  node--nodeid--viewmode.html.twig
  node--nodeid.html.twig
  node--type--viewmode.html.twig
  node--type.html.twig
  node--viewmode.html.twig
  node.html.twig
  
  
  Note that underscores in a content type's machine name are replaced by
  hyphens.


Source: Twig Template naming conventions

In your case this is number 3.

Example:

node--article--teaser.html.twig

If you want to place the template inside the module see: Template for custom content type

In your case this would look like this:

/**
 * Implements hook_theme().
 */
function my_module_theme() {
  return [
    'node__my_content__teaser' =&gt; [
      'base hook' =&gt; 'node',
    ],
    'node__my_content__full' =&gt; [
      'base hook' =&gt; 'node',
    ],
  ];


In my experience you only need base hook. Drupal will discover the correct template name and path on its own. You have to be careful with the underscores (_) in the theme hook, they should match exactly the hyphens (-) of the template name.