There are two different kinds of pinning in chat. Pinning a conversation (from the 3-dot menu at the top of an open chat) keeps that DM near the top of your chat list, above your other unpinned conversations, so it's easy to find again later. This only affects your own view — it doesn't pin anything for the other person.
Pinning a message (available in a conversation) instead highlights one specific message for everyone in that chat, showing it near the top of the conversation as a shared reference point — useful for something like an important announcement or a plan everyone needs to see.