For mammalian children like your cat it is always a good time for a playtime unless they are sleeping or are otherwise temporarily distracted by their physiological needs. So I think it's not really impossible to set playing threshold, optimally the threshold is that they should be engaged in interaction until tired because constructive playtime is how young mammals fulfill their cognitive development, learn socializing and flex their minds. But of course as you noticed, babysitting kitten might quickly get tiresome and draining task because their energy seems to be limitless and no matter how long you play it would never seem enough.

I think one solution to consider is adapting one more kitten of similar age, if you could of course. A saying I encountered a few times tells it's double the fun and half the trouble. Of course it's not always true because sometimes introducing another cat could cause more problems than it solves if they don't get along, but it's quite accurate reffering to little kittens. It's not kittens but the adult cats that are prone to not getting along. One thing to keep in mind is that another kitten would provide your pet a beneficial and distinct type of interaction, the one that a human isn't capable of providing. It is not essential as cats are solitary animals, but nonetheless beneficial.

As for the issue with midnight activity I don't think it's really possible to reliably train a cat to be quiet at night, at least not in the sense you could do with a dog, because by their nature cats are nocturnal animals. By that I mean a cat could learn that you tend to be inactive and unresponsive during night - but that wouldn't prevent it from being active itself, searching other stimuli while making a lot of noise or interpreting even your subtlest movement-related sounds as perfectly valid playtime invitations.

Also for the reason of your kitten's behaviour I think you are right with the diagnosis that it's due to attention deficit and loneliness. But generally I think that even if you decide to not take any action, the whole issue should get better and at least partially resolve itself as your cat ages.