Mathematically, the seemingly easy conclusion of "you double his hit chances" is wrong. Actually, you cut in half his miss-chance.
However, looking at it from a purely mathematical point is very, very time consuming because there is so much to factor in. Ok, granted, if you both have a weapon and you both do a standard attack, then yes, you can have math tables. But more often than not, you don't. Because if you were doing standard attacks with standard weapons, god that would be boring. So you have specials. And now it gets interesting. What your friends special attack worth? And what do you trade in for it? Do you have a special attack, too? Do the special attacks can be done all night, or do they exhaust like spell slots?
Helping your friend means his attack will hit more likely. On the other hand, your attack has no chance to hit at all. So if
your hit chance * your average damage
is smaller than
(100 - (100 - (his hit chance)) / 2) * his average damage
then go ahead and help him.
Hit chance means the percentage. If you need a 17 on a d20 to hit, that's 20% hit chance for example (a d20 has 20 sides, so each side will come up 5%, and for a 17 you can use 4 sides, 17, 18, 19, 20). This formula does not take criticals in account.
But I would say for the sake of having fun, skip the math lesson. If your friend does something cool, that should land straight in your opponents face, go give him a hand. This is a game, have fun playing it. Math can wait for monday morning.