Abd al-Jabbar al-Khawlani narrates: One of the Companions of the Prophet (peace and blessings be upon him) entered the mosque, and Ka'b was there telling stories. That Companion asked: "Who is this?" The people said: "This is Ka'b, telling stories." The Companion said: "I heard the Messenger of Allah say: 'No one should tell stories except a ruler, or one appointed (that is, one officially assigned to this task), or an arrogant person.'" This reached Ka'b, and after that he was never seen telling stories.
Ahmad recorded it; its chain is hasan (good).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب العلم / 907