It's used to replace the following preprocessor code:
#ifndef _MYHEADER_H_
#define _MYHEADER_H_
...
#endif
A good convention is adding both to support legacy compilers (which is rare tho):
#pragma once
#ifndef _MYHEADER_H_
#define _MYHEADER_H_
...
#endif
So if #pragma once fails the old method will still work.