In Islam, a Muslim is permitted as well as encouraged to participate in useful forms of recreation and play. Relaxation and amusement are permitted things in Islam as long as the aim is useful and the means are useful and lawful.
Sheikh Yusuf Al-Qaradawi’s in the his book “The Lawful and the Prohibited In Islam” stated that:

Recreation and Play In Islam:

Islam is a practical religion, it does not float in the stratosphere of imaginary ideals but remains with the human beings on the ground of realities and day-to-day concerns. It does not regard people as angels but accepts them as mortals. Islam does not require of Muslims that their speech should consist entirely of pious utterances, that their silence should be a meditation, that they should listen to nothing except the recitation of the Qur’an, nor that they should spend all their leisure time in the mosque. Rather, it recognizes that Allah has created human beings with needs and desires, so that, as they need to eat and drink, they also need to relax, and to enjoy themselves.

A Time for This and a Time for That:

Some of the Companions of the Prophet (peace and blessings be upon 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 Hanzalah Al-Usaidi, a great Companion and scribe of the Prophet (peace and blessings be upon him), 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 (Glory be to Allah)! What are you saying?’ I replied, ‘When we are with Allah’s Messenger (peace and blessings be upon him) he mentions the Fire and the Paradise 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 Allah’s Messenger (peace and blessings be upon 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 and blessings be upon 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.)

The Humanness of the Messenger of Allah:

The life-pattern of the Prophet (peace and blessings be upon him) is a perfect example for every human being. When in private, he would worship his Lord with such intense devotion, standing for long hours in prayer, that his feet would become swollen; in matters pertaining to truth or justice he would not care about anyone’s opinion, seeking only the pleasure of Allah. But in his living habits and dealings with people he was a human being, enjoying good things, participating in small talk, smiling and joking, yet never departing from the truth. The Prophet (peace and blessings be upon him) liked happiness and disliked grief; he sought refuge with Allah from difficulties and troubles which result in sorrow, supplicating, ‘O Allah, I seek refuge in You from distress and grief.’ (Reported by Abu Dawud)

Concerning his sense of humor, it is reported that once an old woman came to him, saying, ‘O Messenger of Allah, pray to Allah that He admit me to the Garden.’ The Prophet (peace and blessings be upon him) told her that there is no place in Paradise for old women. She burst into tears without understanding the deeper meaning of the Prophet’s words. He pacified her by saying that she would not enter Paradise as an old woman; rather, she would enter as a young woman full of vitality. Then he recited to her Allah’s words: ‘Lo! We have created them a (new) creation. And made them virgins. Lovers, friends.’ (Al-Waqi`ah: 35-37) (Reported by At-Tirmidhi)

Relaxing the Mind:

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 better to travel on the long, arduous path of striving in the cause of truth and justice. `Ali ibn Abi 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 Ad-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 refresh 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 his 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 Almighty says: ‘O you who believe, let not some people mock at other people; it may be that they are better than them.’ (Al-Hujurat: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 and blessings be upon 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 At-Tirmidhi)

Permissible Sports:

There are many kinds of games and sports which the Prophet (peace and blessings be upon him) recommended for Muslims as a source of enjoyment and recreation which, at the same time, prepare them for worship and other obligations. These sports, which require skill and determination, and which also involve physical exercise and bodybuilding activity, are related to the martial arts, training Muslims for the battlefields of Jihad in the cause of Allah.”