cuando se usa "habia" y cuando se usa "hubo"
Se usa en la misma manera en lo que se usa qualquier verbo conjugado en el preterito o el imperfecto.
Había - there used to be, there was (when talking about something that happened at the same time)
Hubo - there was (when talking about a completed action).
Or somethink like that..
I'm not an expert, but here is my understanding. Hubo is the past tense of hay, (which means "there is" or "there are)," so hubo means "there was" or "there were."
Hubo un gato en mi carro ayer. There was a cat on my car yesterday.
Regarding había (I hope this is the same word you were asking about. You did not put an accent mark on the i.)
Había is part of the imperfect indicative tense of the verb Haber, "to have." The imperfect indicative tense is used mainly for something that happened in the past with no set start or finish point, as opposed to the preterite which implies a start/finish.
Example of preterite: I rode my bike to school yesterday. Example of imperfect indicative: I rode my bike a lot when I was young.
Haber: Imperfecto de indicativo
había habías había habíamos habías habían
So with that said, we now need an expert to use había in a sentence. I don't feel confident with that.
Tim, afown gives two great examples of the uses of había in the blue comment box following my last post. I also just found this sentence in my spanish textbook:
Durante el siglo pasado había menos contacto entre los dos países.
During the past century there was less contact between the two countries.
In this case it is describing an ongoing situation.
So after thinking about all this and reading other people's input, I think an easy way to think about it is to use hubo where you would use the preterite, and use había (conjugated to the subject) where you would use the imperfect indicative.
Edited to add: And that is exactly what afown said in the second posting, lol! (Gee I'm sharp!)