Holy cow, I wrote a book!
The answer depends on which "hard drive almost full"
warning you're talking about.
Note that these boundaries are merely the current implementation
(up until Windows 7).
Future versions of Windows reserve the right to change the thresholds.
The information provided is for entertainment purposes only.
The thermometer under the drive icon in My Computer uses
a very simple algorithm:
A drive is drawn in the warning state when it is 90% full.
The low disk space warning balloon is more complicated.
The simplified version is that it warns of low disk space
on drives bigger than about 3GB
when free disk space drops below
The warnings become more urgent when free disk space drops below 80MB,
50MB, and finally 1MB.
(For drives smaller than 3GB, the rules are different,
but nobody—to within experimental error—has
hard drives that small anyway, so it's pretty much dead code now.)
These thresholds cannot be customized,
but at least you can
turn off the low disk space balloons.