Answer: If you are building a retaining wall to hold back a slope, you will need to go below the frost line in the soil for your footer or foundation. You will also need to use gravel and sand as a base for your retaining wall. Your local county extension should be able to tell you how deep the frost line is in your area. I should mention that retaining walls are often subject to local building code requirements.
If you are using a specialty paver product, please check with the manufacturer for their recommendations on using their product for your type of project. They should be able to tell you how their product is designed to be installed for best results.
If you are just trying to create a tidy ornamental edge to a flower bed using cut stone, you could simply dig a shallow trench, add gravel and sand to the bottom of it, and adjust the sand depth to level the stones. Putting the stone vertical about three quarters of its height down should help prevent it from moving. The drainage layer also helps to prevent the stones from moving during the winter freeze/thaw cycles. This type of single stone height edging is done without mortar in areas with freezing winter weather because shifting will cause the mortar to crack.
Or, if you are using natural stones and the wall is very low where shifting would not cause any danger, you can simply lay out the stones in a line and adjust them periodically if they shift during the winter.
If you are actually trying to construct a stone wall, I would suggest you take a look at a book or two from the library for instructions and illustrations of the various ways to do work with stone. It is a little bit more complex than the scope of this gardening Q&A service.
Best of luck with your project!
Q&A Library Searching Tips