It normally stops by the time a baby is a year old, when the ring of muscle at the bottom of their oesophagus fully develops and stops stomach contents leaking out.
It can also help to sleep sitting propped up a little as gravity will help (to a certain degree) stop the stomach contents making their back way up into your throat if you are upright.