Begin your sequences with a click track (metronome sound) that starts at least 2 measures before the first real sound is supposed to come in. There is no standard # of measures for loops. Maybe some of the Acid Loops users can comment more on this.
You keep your music on the beat the same way you would if you were playing live. Practice.
Quantization adjusts the start times of MIDI notes closer to exactly on the beat.The right sound is generally somewhere between perfect (which sounds like a computer) and sloppy which sounds like a drunk. CW even has a function to move note start times in the other direction, called groove quantization.