It is disliked to praise someone to his face as it is feared that it will cause him to be arrogant, and the permission to do that if the person is safe from that happening

Riyad as-Salihin (The Meadows of the Righteous)

by Imam Nawawi

360. Chapter: It is disliked to praise someone to his face as it is feared that it will cause him to be arrogant, and the permission to do that if the person is safe from that happening

1788. Abu Musa al-Ash'ari said, "The Messenger of Allah, may Allah bless him and grant him peace, heard a man praising another man, extolling him greatly. The Prophet said, 'You have destroyed him - or you have broken the man's back.'" [Agreed upon]

1789. Abu Bakra reported that a man was mentioned in the presence of the Prophet and a man praised him heartily. The Prophet, may Allah bless him and grant him peace, said, "Bother you! You have severed you companion's neck,' saying it several times. "If one of you must praise someone, he should say, 'I think such and such' if he thinks the person is like that. Allah is enough for him and no one should commended and praised in front of Allah." [Agreed upon]

1790. Hammam ibn al-Harith reported that a man began to praise 'Uthman and al-Miqdad went and knelt on his knees and began to throw pebbles in his face, 'Uthman said to him, 'What are you doing?' He said, 'The Messenger of Allah, may Allah bless him and grant him peace, said, "When you see praisers, then throw dust in their faces."'" [Muslim]

These hadiths forbid it while there are many sound hadiths which permit it. Scholars say that the mention of combining the hadiths is to say that if the person praised has complete faith and certainty, self discipline and full knowledge, then he is not tempted or deluded by that. His self will not play with him and so it is neither forbidden or disliked. If any of these matters is feared for him, then it is strongly disliked to praise him to his face. It is on the basis of this distinction that the hadiths about that vary. Among those which allow praise is what the Prophet, may Allah bless him and grant him peace, said to Abu Bakr, "I hope that you will be one of them," i.e. one of those who will be invited to enter by all the gates of the Garden." In another hadith, "You are not one of them," i.e, those who drag their waist-wrappers out of arrogance." The Prophet, may Allah bless him and grant him peace, said to 'Umar, "Shaytan does not see you travelling down one pass but that he travels by a different pass." There are many hadiths which allow it, some of which can be found in Kitab al-Adhkar.