Both verbs mean to hide, or “not let to be seen”.
Esconder s to keep an object so that it is difficult to find it:
Voy a esconder el dinero para que mi padre alcohólico no lo vea = I’m going to hide the money so that my father alcoholic wouldn’t see it
Me voy a esconder en el armario = I’m going to hide in the closet
Ocultar is, basically, to hide, not to reveal some information:
¿Por qué me ocultas la verdad? = Why do you hide the truth from me?
Adela ocultó su verdadero nombre = Adela hid her real name
So, esconder works better with objects and people, not abstract ideas, while it is correct to use ocultar with abstract ideas and not with physical objects.
However, in the literary style it is possible to say:
El sol se ocultó tras el horizonte (culto) = The sun hid behind the horizon
There is a contrary tendency: as the verb ocultar is perceived as overly literary, in the colloquial speech the use of esconder sometimes expands to the world of ideas:
NO MUY CORRECTO PERO ADMISIBLE: ¿Por qué me escondiste la verdad? (coloquial) =
CORRECTO: ¿Por qué me ocultaste la verdad? = Why did you hide the truth from me?
Sometimes, both verbs can be used with the same subject but with a different meaning:
El profesor escondió los resultados del examen = The teacher hid the exam results = He put the paper with the results (an object) in a safe place
El profesor ocultó los resultados del examen = The teacher hid the exam results = He didn't say about the results (information) to anybody