The 19-year-old made his debut for the senior side in May 2016 and has gradually begun to work his way into manager Brendan Rodgers's plans, making seven appearances so far this season.
"It's a great feeling to sign with the club I've been with since I've been young," Ralston told the Celtic website. "This is where I want to be and I want to start playing more games. I've enjoyed getting a taste of it and I'm looking forward to the future.
"It's great, with the length of the contract, to have that out the way and I can focus on the football side of things. It's a great feeling and I'm delighted.
"There are so many ups and downs that come with being a footballer. I've enjoyed the experiences I've had up to now. With the injury, it's just one of these things that happen and it's how you come back from it.
"But it's been a good start for me in my career and signing the contract now, I'm just looking forward to getting on with my football over the next few years."
Ralston was memorably pictured in a row with Paris Saint-Germain striker Neymar during the two sides' Champions League encounter at Celtic Park in September.