Noble and below, I usually find that I can neglect my military pretty much all the time until late game. That is, having one archer in each city, two at border cities just in case, and then upgrade them to longbows when I happen to remember them, and finally upgrade the longbows to infantry or sometimes directly to mechanized infantry. It's a bad habit, but I always forget about my military until I find myself at a significant technological lead and have too much production on my hand. I think Noble and below it's pretty safe to rely on the diplomatic modifiers to see who is likely to attack and who isn't. But if one really has to say how many military units is enough, I seem to recall some veteran Civilization players saying, "you can never have enough military units." For just learning the game, perhaps start with this general rule: if there's nothing you need to build in a city, then have it build military units.