What a title tag is
The title tag is the <title> element in a page's head. Browsers show it in the tab, and search engines use it as the main signal for the blue headline of the search result (the "title link"). It is one of the most important on-page SEO elements because it tells both users and search engines what the page is about.
It is different from the H1, the visible heading on the page, although the two often say similar things.
Ideal length
Google truncates titles at roughly 600 pixels, about 50 to 60 characters. Put the main keyword and the most distinctive words first and the brand name last, so nothing important is cut off.
Writing titles that rank and earn clicks
Write a unique title for every page that matches what the searcher wants; lead with the topic, then a reason to click (a number, the year, "free", "with examples"); keep it readable rather than a keyword list; and avoid boilerplate repeated across many pages.
Since 2021 Google rewrites titles more often when they are too long, stuffed with keywords, identical across pages or do not match the H1. If your titles get replaced, simplify them and align them with the page heading. Pair each title with a specific meta description.
Example
A title tag:
<title>What is a canonical tag? rel=canonical explained · RareMatter</title>