Wales, semi-finalists five years ago, moved top of Group A before Italy host Switzerland later in the day in Rome.
Captain Gareth Bale missed a penalty before setting up Roberts for his goal during injury time.
“We’ve given ourselves a brilliant opportunity tonight,” Ramsey told the BBC.
“It (the penalty) was a big moment in the game but we dug in, to a man we left everything out there. That’s what we’ve built our success on.”
Turkey are facing an uphill challenge to reach the knockout stage after losing their first two Group A matches without scoring.
“This seems to be a difficult qualification for us now,” Turkey coach Senol Gunes admitted.
“Tonight Wales had a good start but we’ve found our tempo and we’ve balanced the game after. We had many chances but couldn’t find the equaliser.”
Gunes dropped Juventus defender Merih Demiral after he scored an own goal in Friday’s tournament-opening defeat in Italy.
Robert Page kept the same Wales side from Saturday’s 1-1 draw with Switzerland in Baku.
A pro-Turkish crowd was expected due to the close links between Ankara and Baku, solidified by Turkey’s support of Azerbaijan in last year’s conflict in Nagorno-Karabakh.
Every early Wales touch was welcomed with whistles from the 30,000 crowd, with up to 4,000 Turkish fans having travelled, including President Recep Tayyip Erdogan.
In a very open first half an hour, both sides had very good chances to open the scoring including Turkey skipper Burak Yilmaz, whose effort was deflected out for a corner, and Wales’ Ramsey.
With opportunities at both ends as the two teams refused to sit back, the Crescent Stars had two efforts blocked by last-gasp defending on the 30-minute mark.
With two minutes of the half remaining the vocal ‘home’ support were stunned into silence by Ramsey’s opener.
Bale found Ramsey free in the box and the Juventus man chested the ball down before side-footing coolly past Ugurcan Cakir, making amends for missing two glorious earlier chances.
– Bale wastes spot-kick –
The muted crowd rediscovered their voices after the interval as Turkey pressed forward for an equaliser, their best chance falling to Yilmaz who sent his volley from close range high into the stands.
The game remained open going into the final 30 minutes and Ramsey was just stopped from adding a second as Cakir blocked with his foot, before Bale had an opportunity to seal the three points.
He charged into the box and was tripped by Zeki Celik but the one-time most expensive player in the world fired his penalty over the crossbar.
Page brought Ethan Ampadu on for the tiring Joe Allen, one of just two players remaining from the starting team in the semi-final defeat by Portugal in 2016, with a quarter of an hour left, before Gunes sent on Halil Dervisoglu to partner Yilmaz up front.
Turkey, who were knocked out of the group stage in France at the previous tournament, applied incessant pressure in the closing moments.
With three minutes left, Demiral had a golden chance but his free header from a Hakan Calhanoglu corner was brilliantly saved by Wales goalkeeper Danny Ward.
A scuffle broke out in the Wales box at the start of injury time after a collision on the floor and Ben Davies, Chris Mepham and Yilmaz were shown yellow cards before Page’s men grabbed a second goal.
Bale powered into the box from a short corner, found Roberts and the Swansea right-back claimed his second international goal to send the 400 Wales fans into wild celebrations behind the goal.
Turkey face Switzerland in the Azeri capital on Sunday while Wales head to Rome at the same time.