Press G. That's the default toggle for the landing gear in Microsoft Flight Simulator X.
Two caveats. It only does anything in an aircraft that has retractable gear — a Cessna 172 will ignore you, since its wheels are fixed. And you should be above a safe altitude with positive climb before retracting, because a slow aircraft that loses gear drag can behave differently than you expect.
You can rebind it under the Controls assignment screen if G conflicts with another add-on.