First of all you must have "Unlimited weapons" selected in the realism settings. Fixed gun ammunition will not run out no matter what, if it does you don't have the box checked. When you've fired all your rockets, dropped all your bombs and/or fired all the rounds from your extra cannon (applies mainly to Bf 109 and Fw 190) you press the button combination you've assigned for "Refill Selected Weapon" - the default is Ctrl + J - and keep going. Landing and taxiing to the hangar is only good for immersion factor.