There are two common causes. The fuel tank sender unit and the dash gauge. If the warning indicator (if so equipped) sounds or the miles to empty (if so equipped) shows empty, the problem is likely the sender unit in the tank.
If neither of these indicate the gauge may be bad. Another sign of a bad gauge would be no movement, when the key is switched from off to on. If the gauge rest on the peg, but moves to empty when the ignition is turned on, the gauge is likely NOT the problem. No movement would indicate a bad gauge. Both can be easily tested with a scan tool capable of interacting with the body control module.