If you are using GWX which i assume you are... this is the effect of buoyancy being simulated. Real U-boats had the problem with constantly trimming to prevent the conning tower breach the surface thus giving away their position.
there are four possible solutions.
1. for periscope depth, order the boat to approximately 14 meters and make fine adjustments to depth using the shallow depth gauge. this will be particularly difficult in rough seas, use the P key only fir INITIAL periscope depth order and realize that the boat is going to run about 4 meters shallower than you acually order. (the margin of error is INCREASED the slower you go... so it will only run a meter or two shallower with speed of 2 knots or greater)
OR
2. use JSGME to enable the "reduced positive buoyancy mod" this will lower the effects of buoyancyin the game.
OR
3. Uninstall GWX and play stock (which i DO NOT recommend)
OR
4. Wait and see what the GWX crew might have done about the buoyancy issues in GWX 1.04