First of all, it’s worth remembering that an analogue video signal, which is what a VGA card generates, has no inherent horizontal resolution. The signal source generates a specific number of horizontal scanlines one below the other (which determines vertical resolution) at a specific refresh rate, which the monitor must be able to adapt to, but the level of detail on the horizontal axis is simply whatever the source manages to produce. A CRT monitor will not care. (LCDs on the other hand might, as they actually do try to recover the original framebuffer pixels to match them against their own pixel grid. But more on that later.) This is why some people would sometimes speak of ‘200-line’ or ‘400-line’ modes, and why the conventional notation for screen modes (e.g. ‘576i’ or ‘720p’) only mentions the vertical resolution (though for digital video it no longer really makes sense). It can be occasionally good to know when performing obscure video mode tricks.
Furthermore, though it’s conventionally called ‘the VGA resolution’, 640×480 is not the only resolution at which VGA is able to operate. In text mode, it generates a 400p analogue video signal at 70 Hz refresh rate. A VGA-compatible monitor has to be able to show 480 scanlines in graphics mode, so it surely should be able to display a mere 400 of them when in text mode. At least that was the case at the time.
Of course the VGA card in text mode does, in fact, generate the signal from the glyph bitmaps of the character mode font, which actually has an inherent horizontal resolution. The most common text mode renders an 80×25 grid of character cells at 9×16 pixels each, giving text mode an effective resolution of 720×400 pixels. And you are of course right to notice that 640 pixels are not enough to store a whole single scanline of that mode.
However, character cells are merely often 9 pixels wide, and the glyph bitmaps are never. The glyph bitmaps are actually 8×16, drawn inside character cells that could be either 9×16 or 8×16. The ninth column of pixels in a character cell, if present, is not encoded in the glyph bitmap, but is generated by the graphics adapter: either entirely blank or, if the character index is in the box-drawing character range [0xC0, 0xE0), by repeating the eighth column. The EGA and VGA have a specific register responsible for switching between width-9 and width-8 character cells: sequencer register 1, bit 0. Toggling it will switch the effective horizontal resolution in text mode between 720 and 640 pixels. And when the VGA card is in 640×480 graphical mode, the character cells (now a software-only concept implemented by the video interrupt services) are 8 pixels wide.
As a side note, video card firmware often tweaks the font slightly when width-9 character cells are in use, to take advantage of wider character spacing. Here’s a sample of fonts from the ‘VGA Text Mode Fonts’ collection:
Stephen Kitt’s answer also points out (which I am not going to restate in entirety) that on early laptops with 640×480 LCD screens, width-9 character cells were not supported at all. And from my superficial testing, it seems they are no longer supported on relatively modern laptops either (I tried it on a couple of laptops with Intel graphics, one from 2004, the other from 2010; no width-9 font variant was installed, and toggling the register bit had no effect).0 So these days, if text mode is used at all, the horizontal resolution will probably be 640 pixels after all.
0 Interestingly, the text mode font used by DOSBox contains glyphs optimised for width-9 cells, but DOSBox does not actually implement width-9 cells either. Ironically enough, QEMU, which doesn’t actually care all that much for accuracy of reproduction, does emulate width-9 character cells (though SeaVGABIOS seems not to include a separate width-8 font variant either).