To save a template from a single element, select it and click on Save template from the Templates panel. Enter the desired template name and the template will be added to the list.
Saving templates from a collection of elements is achieved in a similar way. Select a parent/ancestor element and click on Save template from the Templates panel.
If you click on Save template without selecting any element, the template will contain every element on the page.