It's been said that if you retract the gear at a critical moment that performance will actually be worse than if you left the gear down. However, is this really true, and just how long is the performance worse for? Obviously in the long run it'd be better to have the gear up, so how much drag is there actually?
Of course gear doors create drag when open. The question is "how much?"
As you suspect, door drag is not the critical factor here. As usual the answer to your question is aircraft-specific, and your question is pointing to a generalized "old wive's tale" which is only true sometimes.
OK, what is the story behind the story? Look at this Youtube video. Watch the main gear as it enters/exits the storage wells in the fuselage. The axles of the wheels are close to parallel to the direction of flight, which means the wheels are being dragged broadside in the slipstream. A very high drag scenario which will affect aircraft performance. The POH recommendation is (from memory, now) to climb over critical obstacles on takeoff with the gear down, and raise the gear only when the obstacle is cleared. The attached video shows why.
This advice does not pertain to all planes. Know your plane, read the POH. Oh... and ask questions here!
It depends on the airplane, of course, but opening the gear doors will cause more drag just as anything sticking out into the wind stream will. As a pilot you don't need to know "how much" drag is created because the manufacturer has already developed the performance numbers and procedures for you to use.
These numbers are developed by actually flying the airplane and will include the performance loss due to the movement of the gear/gear doors. If the manufacturer finds that the performance loss is too great, they will create an operational pilot procedure that requires the gear to remain down. Otherwise, long term, it is better for climb performance if it can be raised.
Part 23 commuter and Part 25 aircraft have specific climb gradients that must be maintained even with an engine loss, the gear down, and the gear doors open (normally the worst case scenario). The manufacturer must ensure that the aircraft can meet this performance requirement somehow (sufficient engine power, reducing maximum allowable takeoff weight, etc.) and as long as you follow the Flight Manual requirements you will get the best possible performance from the airplane.
They tried every combination (and told you about the best) so that you don't have to be a test pilot and start experimenting when something goes wrong. :)