Candles does not end, they are abandoned. When a new candle is created, the old one just stops updating. This always happen after the new candle is created, of course.
There are blocks like Time filter where you can check the current time. If you want to find previous candle by time, then in "Condition -> Candle -> Candle" set the option called "Find Candle by" to "Time". And write the time in format such as 12:54