How to turn a motor while obtaining the angle it turned?
For the most accurate measurement of the angle, it's common to use some kind of encoder on the shaft.

A potentiometer can be used but will likely not be as precise or accurate, and might have a "dead zone" of a few degrees where it can't measure. 

Another option, depending on the load and accuracy and precision needed is to use a stepper motor and simply count the number of steps or microsteps you drive it with.