Worms do cause diarrhea, and if this is the cause, yes it will stop it. If the condition persists, you little one needs to see a vet. Be very careful with worming, it is very toxic and based on age and weight.
If the diarrhea is being caused by the worms then yes, deworming will stop it. Have a fecal done to make sure the kitten doesn't have any other parasites, like coccidia.
In some cases, yes, if the worms are causing it; remember, kitten stool is not always solid, but it should not be constant either. Consider a vet visit if the kitten loses weight.
It definitely won't hurt, most kittens have worms at some point. Your vet might have some other advice on the subject. If the de-worming doesn't cure it the vet will likely suggest changing to a different cat food. Some cats have sensitive stomachs and it may take some trial and error to find a food that works.