Only a few joules.
This isn't about energy. One could perforate an aircraft's skin with a millimeter-thick punch.
The theoretical deformation energy of 1 mm^3 of metal is UTS*elongation*volume. For 7475 aluminum (one of the strongest alloys used in aircraft), that comes to 0.53e9*0.12*1e-9 = 0.06 J/mm^3. This amount of energy can be slowly delivered even by hand, e.g. with a hand drill.
For a projectile, you'll need to use an armor penetration equation. The Lambert-Zukas formula is the most suitable here.
Plugging the values into the online calculator, a 10*10 mm, 10 gram projectile can penetrate 1 mm of aluminum at 40 m/s. That's an energy of just 8 joules. 1 mm is about the thinnest an airliner's skin can be at any point, usually only in the crown. Most are thicker, and GA aircraft can have skin as thin as 0.5 mm.
To penetrate 1/8" of aluminum, the high end of the range for airliner skin thickness in passenger areas, the same projectile would need 118 m/s. That's an energy of 70 joules.
Energy requirements will scale roughly linear with reducing or increasing the hole's diameter, with 7 J for 1 mm, 35 J for 5 mm.
Note that a 10mm hole will not compromise the aircraft's integrity, airworthiness, or anything else. It will only make a small amount of noise.
Airliners aren't airtight: there is already a much larger hole in the fuselage. They take fresh air in from the engines and dump used air through the outflow valve.

What matters for damage is the size of the hole. Blowing out a window will generally cause some winds in the cabin. It's dangerous to the passengers and there was one case when a blown window caused a fatality, to specifically the passenger next to it.
Some amount of damage will cause worse effects. This amount is unclear and depends on the aircraft. At low altitudes, pressurization isn't necessary, so one can fly open-cabin all the way. As an extreme example, this airplane actually landed.

But most of the time, an aircraft with this amount of damage would not end up landing safely. There was some luck involved. The area torn off was the crown, which doesn't carry much load - the thick and heavy lower fuselage between the wings and the cockpit held it together.
The threshold hole size to risk the entire aircraft is somewhere between these points. Unless it hits something critical.