I’m asking because you’re the certified expert on Elia: is there a precise estimate on who died first between her and Aerys in the Sack and by how much time? Could/would Jaime have protected her if he knew she was in danger once Aerys was taken out?

Well, let’s see. The Sack of King’s Landing occurred before Ned’s army arrived; it was performed, of course, by Tywin Lannister’s men. During the Sack, Aerys had sent Rossart to set off the wildfire caches in the city; Jaime realized this, and killed Rossart before he could leave the Red Keep. He returned to the throne room, told Aerys what he had done, and while Aerys was trying to run away from him, Jaime killed him. This coincided with some of Tywin’s knights entering the throne room to witness Aerys’s death. Jaime told these knights to spread the news the king was dead; they asked who would be declared king in his place, and Jaime considered two names: Viserys Targaryen and Aegon Targaryen. He said they could declare whoever they liked, then sat down in the Iron Throne. He remained there until Ned arrived.

Now with that structure in place, we have to consider the Elia and the children were in Maegor’s Holdfast, a “castle within the castle”. It is in the middle of the castle and therefore you must cut through the castle to reach it. Assuming that Amory Loch and Gregor Clegane were at the head of group that first entered the Red Keep, one can also assume that they bypassed the throne room, and headed through the castle straight to Maegor’s Holdfast, where they scaled the walls and killed Elia and her children inside. Seeing as Jaime still believed Aegon to be alive by the time he killed Aerys, it is most likely that they died around the same time as Aerys or shortly after. This had to have been done before Ned’s army arrived that same day, while the Lannister forces were still fighting people outside the Red Keep. We are talking about very little time here– I’d argue that Ned’s forces were entering King’s Landing at the same time that the Lannister forces breached the Red Keep. So, maybe like half an hour.

Now, we are provided some hints from Jaime’s POV in regards to Gregor’s position and what he was thinking at the time. There’s is this, where is looking back in hindsight:

“The castle is ours, ser, and the city,” Roland Crakehall told him, which was half true. Targaryen loyalists were still dying on the serpentine steps and in the armory, Gregor Clegane and Amory Lorch were scaling the walls of Maegor’s Holdfast, and Ned Stark was leading his northmen through the King’s Gate even then, but Crakehall could not have known that. He had not seemed surprised to find Aerys slain; Jaime had been Lord Tywin’s son long before he had been named to the Kingsguard.

The hindsight is important here, because there is no way that Jaime would have known that Ned was that close, or that Targaryen loyalists were still being killed– so we can also assume he did not know that Gregor and Amory were scaling the walls of Maegor’s Holdfast. But even in this recollection, he makes it clear that he still believed Aegon to be a candidate for the throne:

“Shall I proclaim a new king as well?” Crakehall asked, and Jaime read the question plain: Shall it be your father, or Robert Baratheon, or do you mean to try to make a new dragonking? He thought for a moment of the boy Viserys, fled to Dragonstone, and of Rhaegar’s infant son Aegon, still in Maegor’s with his mother. A new Targaryen king, and my father as Hand. How the wolves will howl, and the storm lord choke with rage. For a moment he was tempted, until he glanced down again at the body on the floor, in its spreading pool of blood. His blood is in both of them, he thought. “Proclaim who you bloody well like,” he told Crakehall. Then he climbed the Iron Throne and seated himself with his sword across his knees, to see who would come to claim the kingdom. As it happened, it had been Eddard Stark.

So even if we did away with the assumption that Jaime didn’t know that Gregor and Amory were breaching Maegor’s Holdfast, it would still seem as if Jaime didn’t know why they were doing so, and didn’t think to inquire. Then, there’s his fever dream:

Prince Rhaegar burned with a cold light, now white, now red, now dark. “I left my wife and children in your hands.” 

“I never thought he’d hurt them.” Jaime’s sword was burning less brightly now. “I was with the king… 

“Killing the king,” said Ser Arthur. 

“Cutting his throat,” said Prince Lewyn. 

“The king you had sworn to die for,” said the White Bull. 

Of course, fever dreams are meant to be taken with a grain of salt, but this does seem to corroborate that Aerys’s murder and Elia’s murder happened very, very close together, and that Jaime had no clue that they the latter was going to be killed.

Now, to address your final question: could Jaime have saved them? In absence of exact times, it’s hard to say whether Jaime could have realistically and logistically saved them. The bottom line is that Jaime didn’t save them because he didn’t know that they needed to be saved. He assumed they would be treated as prisoners of war, not raped and murdered in cold blood. Those murders served a single purpose, after all: to make a statement about Tywin’s loyalty to Robert Baratheon. Jaime did not see that coming.

There is also something to be said about Jaime’s mental state after killing Aerys. He was only 17 years old, he’d been left alone to protect the king, and after months of being told to shut up and let the king do what he wants, just protect the king, Jaime chose his own morals over his oath. He killed the man he was sworn to protect, was caught in the act, and literally had nowhere to hide. Instead, he sat down in the Iron Throne, his bloodied sword across his knees, and waited to see who would claim the throne from under him. Imagine Jaime just sitting in that chair doing nothing for ten minutes, twenty minutes, thirty minutes… then Ned arrives, and Jaime gets up. 

Jaime was addled. He was traumatized. He broke bad and didn’t know what to do with himself after. I think Jaime was sitting on that throne, waiting for someone to chastise him for sitting there, or for doing what he had done. He broke a sacred oath, after all. But no one around him calls him out or even cares. Then Mr. Justice himself walked into the room, and that’s when Jaime feels like it’s time for him to get up.

“I was still mounted. I rode the length of the hall in silence, between the long rows of dragon skulls. It felt as though they were watching me, somehow. I stopped in front of the throne, looking up at him. His golden sword was across his legs, its edge red with a king’s blood. My men were filling the room behind me. Lannister’s men drew back. I never said a word. I looked at him seated there on the throne, and I waited. At last Jaime laughed and got up. He took off his helm, and he said to me, ‘Have no fear, Stark. I was only keeping it warm for our friend Robert. It’s not a very comfortable seat, I’m afraid.’”

This scene says a lot about Jaime. He stares Ned down as he rode the hall in complete silence. His sword was still bloody. Ned waited. Jaime was still wearing his helm. Then, Jaime laughed– because that’s what Jaime does, because he’s emotionally maladjusted and dark humor is how he deals with anything approaching emotional. 

So, could Jaime have saved Elia and the children? No. I really don’t think he could have, for reasons beyond time, and for reasons firmly planted in the idea that Jaime simply didn’t know what else to do with himself after he broke an oath that he had equated with his worth as a knight. That Jaime is haunted by his former brothers in the Kingsguard years after the fact is proof enough that Jaime has made no peace with being an oathbreaker. Jaime sat there to turn himself in, so to speak, but no one would arrest him– not even Ned Stark. And if Ned wouldn’t do it, then who would?