1. Check if the guitar loses tune over a short period of time -
This may mean that the turn keys on the headstock are damaged or badly made.
Putting it simply – the guitar can't hold a tune for a long time and will be a bad purchase.
Turn them around and check if they turn too quickly or turn "too easily" as this will again make your guitar loose tune.
2. Check for any rusting or corrosion of the metal
3. Check for any obvious defects in the manufacturing.
4. Check if the keys turn smoothly or not. It may be jammed.
N.B.: Once a new string is fitted, it begins to stretch under the tension and "gives way" for a first few days losing its tune frequently. There's nothing wrong with your keys in that case.
Read this post fully to exclude problems in your string that can cause similar problems:
Reasons why guitar strings are so troublesome
Liked 'Turn Keys a.k.a Machine head, Gear head, Tuning machine' enough to share / save?