You have a mass m hanging on a string of length L. You pull the mass to one side so that the string makes an angle theta with the vertical, then you let go of the mass.

For the instant after you let go, how do you calculate the tension in the string?

I came up with the equation T-mgcos(theta)=0 and solved for T which came out to be T=mgcos(theta)..
but some of my friends are telling me to set T-mgcos(theta)=ma so T would equal ma+mgcos(theta).

can you tell me if I am correct or my friends are correct? thank you.

Your friends are correct. The mass starts accelerating as soon as you let it go. Once that happens, the forces acting upon it have a vector sum equal to m a, not zero.