The trademark symbol, either ™ or ®, appears after the trademark (when it is in use) in superscript (smaller, raised text). There are a couple of examples above, with the trademark in capitals and the trademark sign to the right of the word, right against it, and raised in superscript. This is the correct usage of the trademark sign, and the use is to put others on notice that the word is being used as a trademark.
The TM is superscript is used when the trademark is unregistered, is an application before the USPTO, or is used as a common-law trademark. The R-in-a-circle sign is for a registered trademark, only those that have been applied for before the USPTO and have passed the examination to move to registration.