Warm up your strings
When tuning your guitar always warm up the strings first. Rub your hand along the length of the strings half a dozen or so times. Failure to do so will see the strings go flat once you start playing due to the heat emitted from your fingertips.
Don't forget to tune in the following order A5, E1, E6, B2, D4 and G3.
Tune your guitar right before you play, even small fluctuations in temperature affect your guitar tuning.