The short answer is that it depends entirely on the physical size of the enclosure and the gauge of the conductors, but genrally, cramming four runs into a small metal box is where problems start occurring. You are right to worry about heat buildup because that is ussually the actual failure point before any physical rule gets involved. The primary concern here isn't just the number of wires, but the volume they take up inside that box.
Most codes have specific rules about 'box fill.' This isn't some vague idea, it's a standard calculation based on cubic inches and how many conductors you have. You need to know the total cubic inches available in your metal enclosure and then check that against the code requirements for your specific wire size. If the box is small, even with four cables, it could be overloaded just by the sheer space the insulation takes up.
It is common for runs of lights to be grouped together, but adding a speaker line just adds another conductor that must be terminated and routed, which eats into the available space and increases the chance of a bad termination if it's cramped. If your current box feels tight, even after using proper connectors, it might be better to upgrade to a larger metal box or perhaps a slightly wider plastic enclosure. That extra space provides necessary airflow and easier access for future maintenance. As for the physical installation, make sure whatever connectors you use are rated for the number of wires and the amperage. When you are making those connections, keep them neat and ensure the wire stripping is precise so no stray strands or excess insulation are taking up space inside the box. A clean, well-terminated setup is what really keeps things safe and functional over time.