The basic idea is that there are radioactive elements in rocks. They have half lives.
Slick scientific geniuses can measure the relative amounts of different isotopes left behind by the primary radioactive elements and come up with a date for when the rock was last melted.
Now that's going to give you a nice early date for a whole lot of stuff ~ but the trick here is that when someone cuts the rock, "weathering begins" on a new surface. Again, there are radioactive isotopes there. The isotopes for different elements weather at different rates (inasmuch as they have different chemical characteristics), so, one more time, really, really, really smart scientific superscientists can figure out how long the cut rock has been aging at the surface.
A far easier method is to find some biological remains at the site, do a radiocarbon 14 test on part of it, and there you have it ~ but that only goes back a few tens of thousands of years, and with a question about cut stone, it'll only tell you when it was put in place, not when it was cut.
When it comes to cut stone these days the archaeologists are very interested in when things were cut ~
NOTE: All of this stuff is expensive to do.
The radioisitope dating I can believe, and the C-14 dating.
But a building stone in the Kaabal - where did it start out, when was it cut, was it used in another structure first?
Weathering, without a complete history, not of the stucture, but of the stone, is nonsense.
Although I do recall one case where a monastary was dated by the wear on the front step ... average number of monks, four masses a day...