Note that she waited only for five months, not the full term. I'd speculate that perhaps her history of barrenness was full of miscarriages, and she wanted to be confident that she would carry this baby to term.
Calvin offers two alternate possibilities as to why:
There might be two reasons for the delay. Until this extraordinary work of God was manifest, she might hesitate to expose it to the diversified opinions of men, for the world frequently indulges in light, rash, and irreverent talking about the works of God. Another reason might be that, when she was all at once discovered to be pregnant, men might be more powerfully excited to praise God.† It was not, therefore, on her own account, but rather with a view to others, that Elisabeth hid herself.
† This is from the Latin version. Calvin's French version says, "For, when the works of God show themselves gradually, in process of time we make less account of them than if the thing had been accomplished all at once, without our having ever heard of it."