Conventionally, it is believed that Shakespeare wrote 38 plays, however, many historians question how many Shakespeare plays can be fully attributed to the Bard himself.
It is likely that Shakespeare wrote in collaboration with other writers, but there is no official record of who he wrote with and how much text he contributed.
We cannot even be certain that 38 plays is the final number! In 2010, publisher Arden Shakespeare released a play called Double Falsehood under the name of William Shakespeare. It is likely that this play will be fully incorporated into the canon bringing the total number of plays written by Shakespeare to 39.