The only thing that will protect you from lightning is unplugging your computer from the wall outlet. And don't forget to unplug the modem. It is connected to the computer, too.
Surge protectors are for surges in power.
They will reduce incoming power surges to harmless voltage levels. They do not protect you from lightning. This contains batteries that provide from five to about 30 minutes of power. This gives you enough time to save your document, close the file, quit the program and shut down the computer. Different computers require different devices, so check your manual for its requirements.