There are a couple of reasons why a piano may not stay in tune:
Frequency Of Recent Tuning: If it has been awhile since a piano was tuned, it needs a couple of weeks to adjust once some maintenance has been completed. A piano might need to be tuned a few times before it starts to sound the way it use to if it does not receive the care it needs.
Mechanical Issues: The tuning pins that hold the strings may not be tight enough to hold them properly. The strings could be expanding, causing it to sound off key. The wood and felt inside could be deteriorating, swelling or warping. A few parts of the instrument might have to be replaced or rebuilt.