"In Islam, iddah or iddat (Arabic: العدة‎‎; period of waiting) is the period a woman must observe after the death of her spouse or after a divorce, during which she may not marry another man.[1] Its purpose is to ensure that the male parent of any offspring produced after the cessation of a nikah (marriage) would be known. The length of iddah varies according to a number of circumstances.

The iddah of a woman divorced by her husband is three monthly periods,[2] unless she is pregnant in which case the ‘iddah lasts until she gives birth,[3] or unless the marriage was not consummated in which case there is no `iddah,[4] or unless she does not menstruate, in which case "the scholars say that she should observe an ‘iddah of a full year, nine months for pregnancy and three months for ‘iddah."[3]

For a woman whose husband has died, the `iddah is four lunar months and ten days after the death of their husbands,[2][5] whether or not the marriage was consummated.[4][6] The period, four months and ten days after the death of a spouse, is calculated on the number of menses that a woman has."  (Source)

And again, Allah Almighty Said:

"(Remember), if you are in doubt about the ‘iddat.’ of your women, _ either because they are past the age, or haven’t yet started to menstruate _ it lasts three months. The ‘iddat’ for the pregnant women (is three months, or it) lasts till the termination of pregnancy. (iddat: the period after divorce during which a woman is forbidden to remarry). Allah (grants a leeway and) makes matters easy for the one who fears Him.  (The Noble Quran, 65:4)"