Most games I will have roughly 1-2 units per city when I don't expect to declare war, located near the border of the civs I expect might declare war on me, dependent on tech level and whether I went for tradition (tradition means up to 1 more unit per city due to no upkeep).
When I begin plans to attack, that increases to around 2.5 units per city, and I use about 80 percent of my units during the war keeping the others at home.
In general with regards to ranged versus melee, you should frequently build 3-4 melee total, and have everyone else be ranged. Melee is inferior in civ5, its mostly for taking cities and hit/run with cavalry. Build more melee when you have tech advantage or a UU, but you will virtually always want 50+ percent of your army to be ranged.
I play on king/emperor, but tactics transfer well down difficulties.