Depending on where you're coming from, and the random selection of the day, you may be able to walk from gate to gate or have to go through a security check before heading on to the next flight.
https://dohahamadairport.com/airport...port/transfers has a lot of info. You may have to obtain your return flight BP at a transfer desk.
15 hours inside the airport isn't appealing at all. If you have a free or cheap visa I suggest getting a hotel in Doha or at least getting out of the airport to see the city. It is far from my favorite city but there are things to see.