What is taught to electrical engineers is that "it is the current that kills".
1mA can put you into ventricular fibrillation you if there there is a current path that goes directly through your heart. One of my projects used a 14KV power supply (very low current) and was relatively safe to work around.
Now I'll answer your question. 24V is generally considered a "safe" voltage because it can rarely break down the resistance of your skin. This is why model railroads generally never went higher than 24V. None-the-less, if you stand in your bare feet in a puddle of grounded salt water and grab onto 24V with your slippery salt water hands, you'll probably feel it and it may be the last thing you ever feel.
In addition to current issues, almost all batteries we encounter in robotics have a failure mode where if you short them, the battery will get extremely hot and possibly catch fire or even possibly explode. If it is a lithium battery, you probably will not have any means at your disposal to put the fire out. Some to the newer and more expensive batteries have a current limiter built into the battery, so a direct short will not cause the battery explosion and catch fire phenomena.
This is a pretty large subject and I am only scratching the surface.
The official answer is that under 50V is safe, inspired largely by the huge bill that would have been incurred to replace all the phone jacks on the 48V system in use.
However, 12V can kill you if you try hard enough and even a couple of volts can be felt if you've got wet skin (tongue on a 9V battery is a good demonstration of an unpleasant but non-fatal zap).
The other thing to consider is the rated voltage of whatever else you're using. 12V, 24V and 48V are all 'standard' voltages for various reasons. It's also better to convert down from battery voltage rather than up.