Of course, we'll consider that the itinerary is on a single ticket/booking, otherwise of course you have to retrieve your bags when switching from one booking to the next. Luggage tag will show the layover point in that case.
The same applies if you actually have a stopover and not a layover, of course. Luggage tag will show the stopover point.
The same applies if you change airports. Have no idea what the luggage tag shows.
If you arrive in the US from an international origin, you have to retrieve your bags to clear customs, whatever the final destination. The luggage tag still shows the final destination and not where you retrieve your bags.
The same rule may apply to other countries as well at least in the international-to-domestic scenario, but it's not universal (you don't retrieve your bags when arriving in the EU from a non-EU origin and you transfer to an EU airport with customs facilities or to a non-EU flight).
I believe if you arrive in the EU from a non-EU origin and you transfer to an EU airport without customs facilities you have to retrieve your bags to clear customs, though I never experienced this so I can't confirm it. No idea what the luggage tag shows.
Not so easy to find a generic rule...