The monster's manual archmage is overpowered, but has a CR12!? It is a monster with Time Stop from 9th circle, mind blank and teleport. If you put him with some other melee monsters (meat for the players to hit), he becomes almost untouchable with teleport and wall of force. In summary, what are the reasons for this monster be CR12 only?
"By the book," the archmage is CR10. (Or even 12; zacm's answer makes some different assumptions than I do below and comes out right at CR12.)
The DMG covers how these numbers are crunched, but I'll give you the bottom line: the archmage has a Defensive Challenge Rating of 3 compared to its Offensive Challenge Rating of 17. (I assume mage armor's up and running for AC 15. I don't count Stoneskin, since L12 characters aren't doing much non-magical Bludgeoning/Piercing/Slashing damage in my experience. I've assumed cone of cold hitting three PCs, three rounds in a row, for the archmage's best expected damage. I might be a touch low, since they could upcast and maybe squeak out an OCR of 18.)
Averaging the archmage's DCR and OCR gives a preliminary (naive) CR of 10; the adjustment up to 12 is presumably due to playtesting during D&DNext. (See also this article where Mike Mearls mentions the Ogre's CR calculation, or any of the many questions we have around CR calculations in D&D5e for plenty more commentary on where official CR doesn't quite match the number-crunching CR.)
Your instinct is sound, though: this is a spellcaster who can do a lot. Your observation that it'd be good strategy to pair him with some meat balances the archmage's obvious weakness: a defensive CR of 3 (I emphasize again)! He's got time stop and teleport and globe of invulnerability and is generally hard to pin down and just hammer on.
But having played against archmages and run them as a GM, I have no problem thinking that 4-5 L12 PCs aren't really in trouble running up against just an archmage.
CR12 for Archmage is exactly in line with the rules for determining CR of a monster in the DMG Chapter 9 (Pg. 274).
Defensive CR is easy-- we take Mage Armor plus the HP and resulting AC to get a Defensive CR of 3.
For Offensive CR we assume the Archmage is playing optimally* for damage: upcasting Cone of Cold three consecutive turns using their 9th level slot, then 8th and finally 7th level slot dealing 12d8, 11d8, and 10d8 respectively, with a conservative estimate of hitting 3 creatures each time, resulting in our 3 turn Damage Per Round (DPR) to be 148.5, which combined with a spell save of DC17, gets us the offensive CR20.
With Defensive CR 3 and Offensive CR 20, we average the two and get 11.5 which can be rounded up or down, which allows us to achieve CR12.
*Cone of Cold is the highest level damage spell we're given, and the one that when upcasted lets us do the most damage with the Archmage-- Mind Blank and Teleport don't do damage which is all CR really cares about. Time Stop doesn't really let us do more damage, although it may on some uses allow the Archmage to cast Fire Shield before then casting 3 Cone of Colds (8th, 7th and 6th level), which is possibly why the CR is rounded up, but that's just speculation.