How effective was WWII bombers self defense anti-air armament?
The only figures I could find were the 60 bombers out of 300 lost by the USAAF in the Schweinfurt raid, most of those losses from German fighters. That convinced the generals that the onboard gunners weren't all that effective, and bombers couldn't defend themselves from a determined fighter attack. Major air attacks on Germany were postponed until the long range P51 could be deployed to protect the bombers better. 

Gunnery from a bomber is far more difficult than from a fighter, that fires straight ahead. In a bomber, the gunner might be firing to the side, which means they have to factor in the bomber's speed that will propel the bullets sideways, and actually aim slightly behind the approaching fighter. The closer to the nose or tail, the less one aimed behind... bomber gunnery is very complex. This wartime training film illustrates the problems of firing on fighters approaching from the side. Try to calculate those ever changing angles when you're being shot at... 

The same difficulties were experienced by ships being attacked by aircraft... very difficult to shoot down a small, fast moving aircraft approaching a ship. The Bismarck couldn't stop slow moving Swordfish biplanes from knocking it's rudders out. In the last major naval action of the war, eight Japanese warships (including the Yamato) were attacked by around 400 aircraft from US carriers. Seven of the eight ships were sunk, while only 14 aircraft were lost in the action, despite those ships having had quite a few extra AA guns added. 

So, why arm the bombers? That was a question asked by Curtis LeMay in 1945. He devised a plan to take most of the guns out of B29's and operate them at night, because the Japanese hadn't demonstrated much in the way of night interception. He reduced the attack altitude to 12k feet from 30k feet, because that put the planes above small arms, but below the effective range of large anti-aircraft cannon. And, he used the weight saved from armament removal to carry extra incendiary bombs, to ignite the largely wood buildings of major Japanese cities. 

The result was the fire raids, the most destructive bombing campaign of the war, even more destructive than the atomic bombs. 

Guns on bombers have been dwindling since then, with the B52 having only one tail gun, while the B1 and B2 have no guns. Still, during Linebacker II, two MIG21's were shot down by B52 tail gunners, so the guns weren't completely useless.