A trademark is a legal right that protects distinctive signs such as names, logos, slogans, sounds or shapes, which identify one business's goods or services and distinguish them from everyone else's. Unlike a patent, it can last indefinitely.
A mark must clear three tests.
National and regional offices handle registration, including the USPTO, EUIPO and WIPO. Classes matter: a mark is registered for particular goods and services, not for everything.
Indefinitely, in principle. A registration runs for 10 years and can be renewed in 10 year periods with no upper limit, as long as the owner keeps using the mark in commerce.
That is the key difference from a patent, which has a hard maximum term no fee can extend.
Two things, and neither is time.
Failing to renew ends the registration. Failing to use the mark can also end it, because most jurisdictions allow a third party to challenge a mark that has sat unused. Some offices require positive evidence of use: in the United States, a Declaration of Use is due between years 5 and 6 after registration.
A trademark protects what identifies your business. Copyright protects creative works. A design protects how a product looks. A logo can be covered by trademark and copyright at once, protecting different aspects of it.