The full phrase is
It always pays to be polite.
This means that whatever the situation, it is always better for you to be polite. 'It pays' means that it will be to your advantage. For example, if you are polite to someone they will be more willing to help you : or in other words, you will benefit from being polite.