SlyFlourish, producer of several books and tips for DM, noted that at level 1 it was a deadly grind.
It might be intentional but I didn't like it that way so I've up-leveled or made them level 2 very quickly.
It was a grind at level 2 but a GOOD grind. At level 1 it's deadly.
Twitter Source
With that in mind, consider leveling them up right away, and that should help many of the issues. At the very least, giving each character a significant percentage of their hitpoints by leveling should help them survive more.
You can see more of SlyFlourish's suggestions for a smooth run of the Greenest in Flames section here
I have run this encounter. They will win easily.
I have run a very similar encounter, with 4 PCs at level 10 against a single Archmage, with all of her spells pre-cast on herself, as the first part of a multi-stage boss fight. As you describe, the battle with the archmage took place inside what was basically a large empty building. The players easily blew through this stage of the fight--even with Time Stop to set up defenses, the Archmage was soundly defeated without a single PC going down.
First, consider that while the Archmage has access to 9th level spells, all of her high-level spells are nondamaging. The strongest damage-dealing spell she has is only 5th level. While Time Stop is potentially useful, it's mostly good for letting her run away with Teleport. Additionally, she only has 99 HP, which means that if she does get caught in a focus fire from PCs, she's going down very quickly.
Second, the DMG has some guidelines for how difficult an encounter is, based on XP thresholds. An Archmage yields 8400 XP, and DMG 82 states that for 3 level 10 characters, the XP threshold for a "deadly" encounter is 8400 XP. That means the Archmage is barely on the edge of being "deadly," which in my experience usually means "one or two PCs actually take some damage". In fact, the daily adventure XP budget for 3 level 10 characters is 27,000 XP, or basically three Archmage encounters before a long rest.
Finally, a single-monster encounter is always on the losing side of the action economy, which further reduces the difficulty of the encounter. For example, if your bard manages to get a Hold Person off on the Archmage, the encounter is basically over, since the PCs get two consecutive turns against the Archmage.
How do you make it more difficult?
You should really be asking, "how do I make this encounter more difficult?". In my case, I made the archmage a multi-stage boss, as mentioned above. In the second stage, I gave her significantly improved survivability, by giving her a regenerating barrier with high HP, which forced the PCs to focus down a portion of the barrier before they could even touch the Archmage. Moreover, I gave her a number of minions under her control, to even out the action economy a bit more.
Overall, these changes did not make the encounter that much more deadly for the PCs, but it did force them to be more creative in their abilities and tactics than a straight fight in an empty room.
Best Answer
"By the books" the encounter is barely a Hard one. But there are huge caveats....
The adult gold dragon is CR17, 18,000 XP. According to the DMG at p.82 your L12 PCs can handle 2,999 XP each in a medium encounter, or 3,000 XP puts them into "hard" territory. And just to remind ourselves:
Caveat 1: preparation/rest.
You haven't mentioned how prepared/rested you expect the PCs to be. In my experience a party of well-rested and -equipped L12 adventurers may have no problem punching out a CR17 creature. (A week ago a L12/13 party of 4 I was playing in had basically no trouble taking out a CR18 boss. And that was with one party member out of the fight--no, out of the plane--for the encounter.)
This also applies to your players: if they're practiced at combat, if they're synergizing well, if they know how to unload when they need to, that's easily a factor of x1.5 or x2 in the hellfire they can unleash on an opponent. If your party's coming in loaded for bear, that's very different than if they're lurching into their final battle wheezing, out of action surges and high-level spell slots, &c.
This, IMO, is a much bigger dial tweaking the encounter's difficulty than is CR.
Caveat 2: GM play.
If you play this dragon as smart, experienced, nimble, and self-preservationist as you can, I think your party stands little chance. You've got legendary resistances, you've got lair actions, you get to set the terrain (the same way the dragon set its lair), and you don't have to play it fighting to the death.
Many GMs, in my experience, play even their smart monsters "stupid," out of a sense of fairness to the players, or out of a desire to avoid TPK. And it's a reasonable concern: if the intelligent enemy focuses on the spellcaster and takes them out of the fight first, it kinda stinks for that player to have to just watch the rest of the table having fun. Much easier just to roll a dParty to decide targets, or to intentionally spread the enemy's attention evenly. And, as we all know, that's the least effective way to make it out of combat alive.
Whether you decide to play this dragon as a creature fighting for its life at all costs or as an expected notch in the belts of your players is an even bigger factor than how prepared the players/characters are.
Again, a much bigger dial tweaking the encounter's difficulty than is CR.