You can take money out of your Roth IRA anytime you want. However, you need to be careful how much you withdraw or you may get stuck with a penalty. In order to make "qualified distributions" in retirement, you must be at least 59½ years old, and at least five years must have passed since you first began contributing.
You may withdraw your contributions to a Roth IRA penalty-free at any time for any reason, but you'll be penalized for withdrawing any investment earnings before age 59 ½, unless it's for a qualifying reason. Money that was converted into a Roth IRA cannot be taken out penalty-free until at least five years after the conversion.
Not sure whether the money will be counted as contributions or earnings? Well, the IRS views withdrawals from a Roth IRA in the following order: your contributions, money converted from traditional IRAs and finally, investment earnings. For example, let's say your IRA has $100,000 in it, $50,000 of which are contributions and $50,000 of which are investment earnings. If you withdraw $60,000, the IRS will consider $50,000 of that to be contributions and $10,000 to be earnings. So any penalty would apply only to the $10,000.