Assuming you are asking about digital input pins on an Arduino:
Digital logic operates at the saturation and cut off regions of the transistor logic used. Most modern day processors use CMOS transistors. The logic levels are Low: 0 V to 1/3 VDD and High:2/3 VDD where VDD is the supply voltage. This information can be found here.
So, if your processor is designed to operate at 5 volts and is likely made of CMOS logic gates, the low level voltage is from 0 to 1.67 volts and the high level voltage is from 3.33 to 5 volts.
But to address your question specifically: Digital input pins do not measure the voltage. Not like an ADC input. Instead, it is agreed that nothing operating normally that is to interface with a digital pin will produce (linger at) a voltage other than those designed to force the transistors into cut-off or saturation.
So do be careful not to do this. It could result in unexpected behavior.
Now, if you can not avoid voltage between the designated upper limit of the low logic signal and the lower limit of the high logic signal you man need to buffer your signal with a device called a Schmitt Trigger. This device adds hysteresis to your signal and converts it into either a low or high logic state. Examples of hysteresis include the thermostat control for your furnace.
A final word, do not exceed the voltage at a digital input to that which is supplied at the power pin of that digital circuit. This can cause all kinds of problems. Usually this is not a problem as most devices / projects are powered off of one power source. But in case multiple power supplies are used, keep this in mind.