Generally speaking you continue your climb after rotation although this will depend on the runway, runway conditions and airport procedures.
Soft Field Take Off: In some cases if you are leaving from a grass strip (still technically a runway) you will go for your soft field take off maneuver. In this case you will actually pop the plane off the ground into ground effect as soon as you can(you will be flying at this point). Then build up speed in ground effect (at a level attitude so you can see the runway fine) then begin your climb out when you have sufficient speed at a climb attitude.
Short Field Take Off: If the runway is short (or there is an obstacle to clear) you will execute your short field maneuvers. In this case you will take off with 1 notches of flaps. Gun the engine but hold the breaks and let the prop spin up. Then as soon as you hit rotation speed pull back to your best angle of climb. Then when you have cleared your obstacle you can level it out to a normal climb t (best rate or what ever you planed for). In this case clearing the obstacle may be more important than strictly maintaining the runway heading (depending on where the obstacle is). In this maneuver you will focus on your airspeed (to keep from stalling) as well as your attitude indicator and your heading indicator to keep as on course as possible.
Air Port Procedures: Some airports have special procedures for departing because of obstacles, air spaces, noise abatements etc. For example I fly out of DYL and they have a procedure on runway 23 that calls for a turn to 250 and climb out to 1200 ft before executing any other turns or maneuvers. Once I have cleared the trees I will usually begin my turn.
Generally speaking you fly the runway heading after you have rotated and you do this using the heading indicator NOT the compass. Since you are in accelerated climbing flight your compass is inaccurate.