When I click on the 'pin post' option it does not pin the post

I’m assuming you’re referring to pinning a topic using the ‘Pin Topic’ option in the topic wrench:

For anonymous, topics will remain pinned to the top of their respective category (and Latest list, if pinned globally), but will be dynamic for users with an account. The pinned behaviour for logged-in users is set by the automatically unpin topics and default topics automatic unpin admin settings:

Though users can change their preference for themselves from their Preferences/Interface page:

You can also toggle the pinned/unpinned status for yourself using the little drawing pin next to the topic title (in the topic, and from the topic list), as well as from the topic controls at the bottom of the pinned topic:

If you check out your forum in a private window/logged out, do you see the topics pinned where they should be?