Simple circuit slowly powering down
The datasheet of the MQ2 says that the heater in the sensor consumes 900mW in normal operation.  

At 9V, that works out to 100mA.  A 9V battery is not intended to deliver that much current.  They are rated for several hundred milliampere hours at low discharge rates.

Drawing 100mAh will drain a 9Volt battery very quickly.  

In other words, the sensor is probably fine, but the battery is not up to the job.



By simple calculation, you might expect a 500mAh battery to last for 5 hours with a 100mA load.

Batteries are not simple linear beasts, however.  The rate of discharge changes the way the chemical reactions take place in the battery, which changes the available capacity.



Checked the datasheet again.  The sensor isn't rated for operation on 9V, so you are powering it wrong.

The datasheet says 5V, plus/minus 2V.  So, between 3V and 7V.

A good way to power it would be to use AA cells.  4 of those in series gives you between 5 and 6V when new, dropping to 4V or so when run down.

That stays in the operating range of the heater over the full operating time.  The AA cells also have more capacity, so it will run longer.



Linked to a different datasheet.  It is stricter, and says 5.0V, +- 0.1V.

So, better to get a buck/boost regulator and operate it from a bunch of AA cells.