Hasan al-Basri (rahimaullah) was an eminent scholar and pious individual of his time. He would rarely laugh due to his remembrance of death and the punishment of hell. One day he was going somewhere when he saw a young man indugled in laughter. Hasan al-Basri asked the youth, "Young man, have you already crossed the bridge of Sirath? Have you already found out whether you are going to paradise or hell?" The young man replied, "No." Hasan al-Basri told him, "Then why are you laughing so much?" After that, no one saw this young man laughing again as he came to know the reality of this life.
Source: Story extracted from the book "Tambihul Ghafileen" by Shaikh Abul Laith Samarkandi.
Many hours or probably days have passed away from our lives in laughter and jokes. It is a sign that we have forgotten the life of the hereafter. The sahabah used to do good deeds all day but still cry during the night to Allah. On the other hand, we do sins all day and still have no concerns! It is permissible to laugh at amazing things and smile while being in company of others.