The phosphor arrangement on the front of tubes vary. Some have the colors staggered, while others just have stripes. Regardless, only areas actually hit by the stream of electrons that come from the back of the tube during operation will light up. This stream only has limited height, and it scans horizontally across the screen, steps down a hair, then repeats. This is what creates your scanlines.
The number of scanlines is determined only by the input signal. How tall (or "thick") the scanline is will depend on several factors, mostly the dot pitch of the CRT, how high you've got the contrast knob turned up, and the condition of the tube.
Note that there aren't really any discrete horizontal pixels at all. The monitor has no idea that there are discrete pixels horizontally. All it sees are three color intensity signals that happen to have stairstep changes in it (which is where the pixel boundary is).
Again, there's no direct mapping between the phosphors on the front of the CRT and the actual displayed resolution.