Usually we use the 时间 as a noun,we use it to ask "what time is it?现在是什么时间?Most of the time ,it present a time recently.contrastly “时候”is used to ask something occurred in the relatively long period of time .just like "when do you like to go shopping?"你想什么时候去购物?"
in a short word ,Most of the time.
"时间"=time and "时候"=when