When you run through a green race gate a race begins and a timer begins to count down. To finish the race you must reach the red finish gate and pass through it. If you pick up a point/prize bubble while racing, the timer will momentarily pause. The amount of points you score is based on your finishing time. There are several races in the story of LittleBigPlanet.
Race gate

A player passing though a race gate