They almost never come loose if they are in good condition, and are the correct parts, so I suspect that something is wrong. First check that there is a steel sleeve inside the rubber bush. You should then have a large, thick washer each side of the bush. If the wrong washers are fitted, i.e. too thin, the nut may be bottoming on the end of the screw thread instead of clamping up properly. The way such joints work is that the steel sleeve MUST be gripped tightly when the bolt is torqued up, and it is purely friction that prevents it chattering, as there is always a slight clearance between the bolt and the internal diameter of the sleeve. The washers are there to prevent the rubber from squeezing out.
You should have a through bolt, fitted from the rear, with a spacer between the arm and the first large washer. If it is an older car, with the one-piece pin with built-in spacer, throw it away and get a new bolt, spacer and nylok nut. Renew the nut anyway, as it will have been used too many times already. The reason for getting rid of the old pin (both sides of the car) is that, due to needing to clear the very limited internal chamfer of the bore of the large washers, the radius between the "bolt" and "spacer" parts is very small, creating a stress raiser, and fatigue fracture occurs at that point. It happened to me in my first Mini, so I would advise never, ever using the old design of pin. It is rather dangerous, because not only do you suddenly lose damping on one wheel, but there is a very real danger of knuckle disengagement, resulting in suspension collapse and probably an accident. Fortunately that did not happen to me, but is has been known to happen to others.
If it still will not stay tight, replace the lot, i.e. the bolt, nylok nut, both washers, spacer and the sleeve, as parts that are badly worn are probably just not going to work properly again. Unfortunately the sleeve comes with the damper, so if it is damaged or missing, you will theoretically be needing a new pair of dampers (always change them in pairs to avoid assymetric handling). However, ask around here, and someone is bound to have an old damper with sleeve intact.
You do need to fix this asap, because it is not just an annoyance but a very real safety risk, because when loose bits are hammering each other, something is going to break eventually, and if that turns out to be the top arm, it may cause a disaster. That goes for anything that knocks or rattles, in some cases there is no real risk as the thing that breaks is not all that important structurally, but nevertheless something is being stressed improperly and damaged, so knocks, squeaks and rattles from mechanical parts are costing you money. Always best to fix them.
If you find that the bolt seems loose in the top arm, check the arm carefully for damage or cracking, and if there is any, scrap it, as it is a very highly stressed part. But if it is ok, but the hole is slightly worn, use the strongest grade of Loctite on the bolt, put it in place with some washers and a nut, and nip up firmly. Leave it for the Loctite to harden, then remove the nut and washers, and assemble everything as normal. The reason for not just bolting it all up when the Loctite is fresh is that the bolt will be becoming a semi-permanent part of the arm, but you really don't want any stray Loctite to permanently fix the spacer, sleeve, washers or nut, as you will need to change dampers from time to time.
One last thing you can do, if all else fails, is to get a grade 10.9 bolt, which mosy likely will have an allen head, and matching grade of locknut, and torque up to 20% higher than normal. Do not be tempted to use a 12.9 bolt, as they may be stronger in tension, but are brittle, and will fail in an application like this.