For example, when you're indicating your weight / height, is it better to use a slider or should the user just type in the value?
In what instances should you use one or the other?
First, let's have a picture of slider:
When to use Slider instead of an input field:
Since sliders can be given input by touch, It doesn't have to open keyboard in mobile. Also it becomes faster to input in mobile devices.
All sliders have starting and ending point which show the broadness of value user can input.
In some cases, user feels good to enter approximate values. For example in ratings, user don't prefer to put 3.45 out of 5. While in case of brightness or volume control, user don't even need the values
First, I would point out that a designer often has the option to implement both. And it also depends on the user, the interface, the environment, the context, etc. It is rarely one or the other. If it is one vs the other...
Input might be more appropriate when:
A slider is more appropriate when:
But seriously, it depends.
A slider vs a number input, the slider gives the user more convenience, the input gives the user more precision.
A slider has predefined limitations. For example a min and max value, they have threshold (you might just let the user select numbers from 10 to 10). This limitations are clear in a slider, but would be strange in an input.
An input however, let's the user specify the exact number, it gives more control without the former limitations.
So it is good to choose a slider when there are certain limitations because they can be easily understood. When there aren't this kind of limitations both can give the same functionality but an input is more precise (imagine selecting an specific number, let's say 682, in a range of 0-1000 in a small slider with a mouse or with a touch device).