Here's an article about the guns
http://uboat.net/technical/guns.htm
In RL the guns were removed from almost all boats in 1943.
As ediko said it's your choice.
It's harder and harder to sink ships with the deck gun as the war goes on.In a training career you could keep it,in DiD it's not worth it.