It was stated that Ace’s mother held him for 20 months (5 months before and 15 months after Roger’s execution) in order to deceive the world of Ace’s connection to the Pirate King. Since Ace’s birthday is January 1, Roger must have been executed sometime between late September and early October.
Several theories claim that Rouge was the previous user of the Gomu Gomu no Mi and that stretching ability along with her haki is the reason why she was able to keep Ace in her womb for so long (as we all know thanks to Gomu Gomu no Mi’s powers Luffy can withstand large amount of distress and pain caused to his body and his internal organs).
But the reason she died is probably because for the 10 months she additionally held onto Ace, she was constantly ensuring Ace was protected. Whether she was constantly using Haki, or using awakened powers like Doflamingo did, I don’t know. But eventually even with the Gomu Gomu no Mi ‘s power 20 months were little out its capabilities and she lost her life!