The Merchant of Venice is a comedy play, which in early modern English theater typically denoted a play that concludes with a relatively "happy" ending. More lighthearted in nature than tragedies, comedies featured characters triumphing over their conflicts and, for English Renaissance comedies in particular, almost always ended with at least one marriage and no deaths.
One can easily, therefore, point to why The Merchant of Venice is categorized as a comedy: nobody dies, the major conflict between Shylock and Antonio is resolved without bloodshed, and the play ends with three budding marriages (Bassanio and Portia, Lorenzo and Jessica, and Nerissa and Gratiano). Also characteristic of early modern comedy is the motif of cross-dressing or disguise, which features heavily in the latter half of the play as Portia and Nerissa convince everyone that they are male officials of the Venetian court.
Despite its clear allegiance to the genre of comedy, however, The Merchant of Venice also stands out among other plays in the genre due to its portrayal of more severe, high-stakes conflict. The pound of flesh that Shylock demands from Antonio borders on the grotesque and shares more in common with Shakespeare's tragedies than it does with his comedies (the pound of flesh, of course, is never actually realized in the play and is merely spoken about in theory, keeping the play from crossing over into the tragic realm). Furthermore, Shylock enjoys commonalities with some of Shakespeare's most famous tragic villains like Iago from Othello and Richard from Richard III, most notably their rhetorical skill that allows them to flatter and manipulate other characters. Indeed, if not for Portia's intervention, Antonio likely would have died fulfilling his contract to Shylock. Thus, The Merchant of Venice is a comedy that flirts with tropes of tragedy, ultimately showcasing the triumph of mercy and other Christian morals over evil.