If you gate-check a bag because the overheads are full it goes in with the rest of the checked luggage and ends up on the carousel at the final destination. If you are flying on a plane with smaller overhead bins the airline may offer a similar feature but the bag will be returned to you at the end of that flight rather than at your final destination.
Either way you shouldn't put anything valuable underneath. Find a way to get it under the seat in front of you if there is no overhead space left. You can always aim for a seat towards the back so that you board earlier and are more likely to have space still available in the overheads.