On a jetliner, the gear goes up as soon as possible. Once the plane is off the ground, the pilot not flying will watch the vertical speed indicator, and when he sees it signal a positive rate of climb for 2-3 seconds (since you cannot trust a v/s indicator's instantaneous indications, it must be taken over a period of time) he will then call out
'Positive Rate', at which point the pilot flying will call out 'gear up', which then the pilot not flying will raise the gear.
Climb out speeds are often well under 200 knots. More like 170....with a rotation speed around 115-130 knots. Of course the heavier the aircraft, the higher these numbers, but the general profile is get off the runway, cut the throttles back, climb up to 2,000 feet (which is when the aircraft will be put on as full command autopilot as possible) then pitch down so increase speed to climb speed, clean up the flaps on schedule, pitch down again to climb to 240-250 kts (since you cannot fly faster than 250 kts when under 10,000 feet).
The gear provides quite a bit of drag, so you want them up as soon as possible, waiting for any period of time is unwise. Now the limit of gears on jetliners tend to be around 250 kts IAS, which means they can be deployed before the flaps, so when an airplane is coming in on approach with too much energy, the gear can be dropped early to assist with the slowing down of the aircraft, that is a perfectly acceptable thing to do, although you will want to stay on top of your aircraft's speed so you dont have to drop the gear on the downwind....