You don't mention your Ubuntu version or your Desktop Environment.
I'm using Ubuntu 16.04 LTS with Unity Desktop.
When the battery starts running low, warning messages (via pop-up bubbles) start appearing. This is designed to give you time to start saving your work and gracefully power down your system.
The other answer references Gnome and if you are on Ubuntu 17.10 you may be using Wayland which may not give you the same warning messages.
In either case this Ask Ubuntu Q&A How to change critically low battery value? should prove helpful. One answer in particular states:
Looks like Gnome moved the settings. Critically low battery is now
handled by UPower. Instead of using gsettings, you should now edit the
file /etc/UPower/UPower.conf
UsePercentageForPolicy=true
PercentageLow=10
PercentageCritical=3
PercentageAction=2
CriticalPowerAction=HybridSleep
I hope this helps!