What is a default gateway

Thanks Maher H for clarifying it.

For the case 1, does it require Router on Stick / SVI (or) we can just assign an ip in the same subnet range on the interface where switch is connected and will it just does routing between subnets ?