Unfortunately we are not exactly certain where Martha Wayles Skelton Jefferson was when she died. There are no contemporary written eyewitness accounts available to us; the best source we have is Martha Jefferson Randolph's account, which she composed many years after the fact:
"For four months that she lingered, he was never out of calling; when not at her bedside, he was writing in a small room which opened immediately at the head of her bed. A moment before the closing scene, he was led from the room almost in a state of insensibility by his sister Mrs. Carr, who, with great difficulty, got him into his library..." 
It is important to remember that Monticello as a building was quite different from its present-day configuration. Bearing that in mind, here is a summary of what our Director of Restoration has said on the subject: Martha Jefferson died on September 6, and from her daughter's comment that she was bedridden for four months before her death, it seems unlikely that she would have been upstairs; the upper rooms would have been uncomfortably hot during the summer months. The "small room" in which Jefferson stayed was most likely the room now called his Cabinet, while his wife was in what is now Jefferson's bedroom (although the alcove bed did not exist at that time). Martha Jefferson Randolph's comment that Jefferson was led from "the room" (presumably his then-bedroom) to his library is somewhat confusing, given that his library at that time was upstairs; it seems unlikely that his sister could have "led" a full-grown man on the verge of collapse up an extremely narrow stairwell. Martha Jefferson Randolph may simply be confusing her memories of Monticello II with Monticello as it was at the time of her mother's death. Jefferson's library would in fact eventually be the next room over from the room he was probably staying in during his wife's illness, but at that time it did not exist. Mrs. Carr may have simply taken her brother to the same room that his daughter said he was writing in during his wife's illness.