Upvote:5
On a single itinerary (ticket) with a "layover" your bag will always be checked through to the final destination .
That's different from a "stopover", where the airport in the middle is a separate stop: Your bags will indeed be unloaded and you have to check in again and get new boarding passes for the second leg.
Mainly the difference is determined by time: Anything more than 23 hours or 24 hours is typically treated as a "stopover". It depends on the specific airlines. You can also book shorter stopovers intentionally, if you want to enforce a specific routing.
If you buy the trip as two different tickets, you will always have to collect and rechcek your bags, since this is treated as two separate trips.