The following excerpt is taken from “The Lawful and Prohibited in Islam” by Yusuf Al-Qaradawi pg. 287, 289:
Following the Prophet’s example, his noble and pure Companions also enjoyed humor and laughter, play and sport, which relaxed their bodies and minds and prepared them the better to travel on the long, arduous path of striving in the cause of truth and justice. ‘All bin Abu Talib said, “Minds get tired, as do bodies, so treat them with humor,” and “Refresh your minds from time to time, for a tired mind becomes blind.” And Abu al-Darda said, “I entertain my heart with something trivial in order to make it stronger in the service of the truth.”
Accordingly, there is no harm in the Muslim’s entertaining himself in order to relax his mind or refreshing himself with some permissible sport or play with his friends. However, the pursuit of pleasure should not become the goal of his life so that he devotes himself to it, forgetting hie religious obligations. Nor should he joke about serious matters. It has been aptly said, “Season your conversation with humor in the same proportion as you season your food with salt.”
The Muslim is forbidden to joke and laugh about other people’s values and honor. Allah Ta’ala says: O you who believe, let not some people mock at other people; it may be that they are better than thee…(49:11) Nor is it appropriate for the Muslim to tell jokes based on what is untrue in order to make people laugh. The Prophet (peace be on him) warned against this, saying, “Woe to the one who says something which is false in order to make people laugh! Woe to him, woe to him!” (Reported by al-Tirmidhi.)
Some of the Companions of the Prophet (peace be on him) attained great spiritual heights. They believed that in order to remain at such a spiritual level they should always be serious, engaged in constant worship, turning their backs on all the enjoyments of life and the good things of the world, neither playing nor relaxing but keeping their eyes and their minds fixed on the Hereafter and its concerns, away from common life and its amusements.
Let us listen to what this great Companion and scribe of the Prophet (peace be on him), Hanzalah al-Usaidi, has to say about himself: Abu Bakr met me and asked, ‘How are you, Hanzalah?’ I replied, ‘Hanzalah has become a hypocrite.’ He said, ‘Subhanallah! What are you saying?’ I replied, ‘When we are with Allah’s Messenger (peace be on him), he mentions the Fire and the Garden until it is as if we can see them. But when we leave the Prophet’s company and play with our wives and children or busy ourselves with our properties, we forget much.’ Abu Bakr said, ‘By Allah, I have experienced the same thing.’ He and I then went to visit the Messenger of Allah (peace be on him), and I said, ‘O Messenger of Allah, Hanzalah has become a hypocrite.’ He asked, ‘And how is that?’ I replied, ‘O Messenger of Allah, when we are with you, you talk about the Fire and the Garden until it is as if we can see them. Then we go out and play with our wives and children and deal with our properties, and we forget much.’ The Messenger of Allah (peace be on him) then said, ‘By Him in Whose hand is my soul, if you were to continue at the same level at which you were when with me and in remembering Allah, the angels would shake hands with you when you are resting and when you walk about, but, O Hanzalah, there is a time (for this) and a time (for that).’ He repeated this phrase three times. (Reported by Muslim.)
Al-Qaradawi, Yusuf (1960). The Lawful and Prohibited in Islam. (p. 287, 289). http://www.islamicweblibrary.com/wp-content/uploads/2019/06/TheLawfulAndTheProhibitedInIslamal-halalWalHaramFilIslamByShaykhYusufAlQardawi.pdf