时间 is used in a particular time.
时候 is used in a wide range of time.
if someone ask you to use 时间, it means pay attention to a specific point in time.
if someone ask you to use 时候, it means need to pay attention to the time period.
you can use a particular time to answer someone who use the 时候.
but, you can not use the time period (e.g afternoon) to answer someone who use the 时间.
But, In real life,
if someone use 时间 to ask a particular time, it sounds like weird for the Chinese ear. If you wanna ask a specific time, use "点" or "点钟"
时候 can be used in a wider range, both specific point in time and the time period. Even can be used in timeline of events.