That's a very difficult question to answer. All I can really do is give you a few tips that should hold true in most cases.
If 'que' is used in order to add more information about a noun then I think it can almost never be omitted. Like for example:
"Quiero <em>una casa que</em> tenga jardín." ----> "I want <em>a house that</em> has a garden."
"¿Hay <em>alguien aquí que</em> sepa inglés?" ----> "Is there <em>anyone here that</em> knows English?"
Or in your example:
"Anoche soñé <em>algo que</em> ahora mismo no recuerdo." ----> "Last night I dreamt <em>something that</em> I can't remember right now."
That example isn't the best because the literal translation sounds clumsy in English so we would just express it another way.
In phrases starting with "querer que" like "Quiero que..." it has to be omitted because "I want that..." doesn't make any sense in English.
E.g. "Quiero que me digas la verdad." ----> "I want you to tell me the truth." Never: <s>"I want that you tell me the truth."</s>
"Tener que" can pretty much always be translated to "have to."
E.g. "Tienes que esperar lo inesperado." ----> "You have to expect the unexpected."
There's a couple of guidelines for you, but take them with a pinch of salt, I'm no grammar expert.