So far my perception had been that you write もの when it is used for grammatical purposes, and 物 when an actual object is meant, but I've encountered many situation where even in the second case it is written in hiragana.
For example:
「これは、いいものを見つけたよ。」
or
「これはいい物を見つけたよ。」