When someone buys a house at a discount off the appraised value, as many bank-owned or HUD homes are sold, the buyer needs to wait a minimum of 6 months before they will be able to refinance and get any equity out of the property. More typically, the waiting period is 12 months.
FHA refinances always have a waiting period of 12 months before any cash can be taken out.
If a buyer wants to refinance to get a lower rate, then they will be able to refinance any time after the closing. The only limitation is that for the first 6 - 12 months (always 12 months for FHA), the sales price and NOT the appraised value must be used to determine the loan-to-value ratio. In other words, if a house sells today for 100K, but has an appraised value of 150K, it will be 6 - 12 months before a lender will allow the borrower to use anything other than the 100K sales price as the value of the house.