I think the usual advice is to keep money you need in the next year in something close to cash. We are closing on a house tomorrow and I sold VTSAX/VTIAX and had the money moved directly into my checking account.
More specifically (and I don't necessarily recommend this to anyone) we took a risky gamble and kept our money in the market until the last minute. The reasons for this were a few-fold. 1) We had been saving up for a down payment in a mix of short-term and intermediate-term bond funds starting in 2009. After several years of saving and hemming and hawing, we decided not to buy at that time, and eventually moved all of that money to VTSAX. We all know what happened to the market between 2009-2012, and I'm still bummed that we missed out on that rush. 2) We had no hard timeline for buying and were okay in the mid-term continuing to rent, though we knew that eventually we wanted to buy. That meant we decided we would buy when we both found a good place we liked and the market was not simultaenously taking a dump. If the market dumped then we would just revert back to investing and put the house purchase plans off for longer.
I think most people don't fall into that situation of flexibility, in which case it makes sense to put your money in something like a money market, CD, savings account, etc. Just make sure that if you get a CD, the term is short enough that you can get the money if you find the perfect place in 6 months instead of 12. Honestly, I think a savings account is the way to go since you aren't going to earn much interest any way you go, and the safety of FDIC insurance and the liquidity is way more important than the extra $34.71 in interest you might earn.