The two answers that have been posted so far are exclusively based on Jane Eyre. An Autobiography and assume that that story's narrator is reliable. Of course, one may well ask to what extent her account of her husband's past can be relied upon, since she does not condemn the cruelty of his imprisonment of his first wife.
In Chapter XXVI, Richard Mason's solicitor Briggs mentions a marriage date fifteen years before Jane and Rochester's planned marriage:
I affirm and can prove that on the 20th of October, A.D. — (a date of fifteen years back), Edward Fairfax Rochester, (...), was married to my sister, Bertha Antoinette Mason, daughter of Jonas Mason, ...
After some resistance, Edward Rochester finally admits,
I now inform you that she is my wife, whom I married fifteen years ago, (...).
In Chapter XXVII, Rochester tells Jane,
I lived with that woman upstairs four years, and before that time she had tried me indeed: (...).
This may lead to the conclusion that Bertha's confinement started eleven years before the events in Chapters XXVI-XXVII, assuming that the years have not been rounded up or down. However, one should not overlook that Bertha Mason's or Antoinette Cosway's confinement did not start at her arrival in England.
In Chapter XXVII, Rochester also tells Jane how he got married and what happened after that (emphasis added):
'One night I had been awakened by her yells—(since the medical men had pronounced her mad she had of course been shut up)—it was a fiery West Indian Night; one of the description that frequently precede the hurricanes of those climates; (...). (...) I was physically influenced by the atmosphere and scene, and my ears were filled with the curses the maniac still shrieked out; wherein she momentarily mingled my name with such a tone of demon-hate, with such language!—no professed harlot ever had a fouler vocabulary than she: though two rooms off, I heard every word—the thin partitions of the West Indian house opposing but slight obstruction to her wolfish cries.
'"Go," said Hope, "and live again in Europe: there it is not known what a sullied name you bear, nor what a filthy burden is bound to you. You may take the maniac with you to England; confine her with due attendance and precautions at Thornfield: (...).
'To England, then, I conveyed here; a fearful voyage I had with such a monster in the vessel. Glad was I when I at last got her to Thornfield, and saw her safely lodged in that third-storey room, of whose secret inner cabinet she has now for ten years made a wild beast's den—a goblin's cell.
This suggests that the years have been rounded up (if eleven is correct) or down (if ten is correct), but we don't know for how many years Bertha or Antoinette lived in confinement while in the West Indies. Rochester says that "here vices sprang up fast and rank", which suggests that this started not long after they were married.
In the beginning of Part Two of Wide Sargasso Sea, Antoinette Cosway/Mason and her unnamed husband (Edward Rochester's name is never mentioned in the entire novel) travel to their "honeymoon house". The man starts to dislike the environment very soon; even before they have arrived at the house, he tells himself that "the woman is a stranger". Near the end of Part Two, he writes a letter:
Then I wrote a letter to the firm of lawyers I had dealt with in Spanish Town. I told them that I wished to rent a furnished house not too near the town, commodious enough to allow for two separate suites of rooms. I also told them to engage a staff of servants whom I was prepared to pay very liberally—so long they keep their mouths shut, I thought—provided that they are discreet, I wrote.
This ties in with "of course been shut up" from Chapter XXVII in Jane Eyre. However, it is not clear how much time passes in Part Two of Wide Sargasso Sea; it is easy to get the impression it covers just a few weeks or, perhaps, months.
Part Three, which is again told from Bertha's or Antoinette's point of view, does not provide clear information on the duration of her confinement. During the dream at the very end, she says,
I passed the room where they brought me yesterday or the day before yesterday, I don't remember. Perhaps it was long ago for I seemed to know the house well.
In fact, Part Three contains several mentions of Bertha or Antoinette getting Grace Poole's keys and wandering around Thornfield Hall, so she must have been brought there long before "yesterday or the day before yesterday". Overall, the events in Wide Sargasso Sea are hard to date, except for its beginning after the Emancipation Act of 1833, which abolished slavery in Britain and its colonies.