Can I mix soldiers from totally different armies? I mean, can I have some, say, Necrons in among my Chaos Space Marines? I have a couple different armies, and I'd like to combine them.
It is perfectly legal to use Necrons with Chaos Space maines so long as you obey all the necessary allies rules.
In standard games of 40K your can field allies with your army using the Allies Matrix. When you do this your select one army to be your primary detachment and the other one as the allied detachment. Your primary detachment works as normal and you select your warlord from it as usual. For the allied detachment you use a modified force organization chart:
 HQ [0-1] Elites [1-2] Troops [0-1] Fast Attack [0-1] Heavy Support
Allied detachments work with your army with varying amounts of efficiency. You can see the full allies matrix below.
From the matrix you can see that Necrons and Chaos Marines are classified as Allies of Convienence. In this instance, it means that troop units from both detachments are scoring, but characters cannot join units from the other detachments. Also, army abilities will treat the units from the other detachments as enemy models
You have an army construction chart you have to agree on with your opponent. If you want to mix armies, you would have to play high points and agree on the scenario with your opponent - see the rules for allies in the 6ed rulebook. They would allow you to field 1 HQ, 0-1 Elites. 1-2 Troops, 0-1 Fast Attack, and 0-1 Heavy Support options from the Dark Angels codex with a Space Wolves detachment, for example. Thats because Space Wolves and Dark Angels are considered "Allies of Convenience". I dont think Necrons get to be allies with Chaos too easily, bot i cant recall the exact table from the rulebook.
In addition to what K.L. said, you can ally just about any army. You just have to have permission from the other player, and a good scenario to explain why certain armies would be allied (say the Eldar and the Necrons who hate each other).
The easiest way to "ally" is to play an Apocalypse game. Those games are meant for large amounts of points and huge armies. Alliances mean a little less because you could be playing each army as an independent or together depending again on your mission.
(and personally I think Apocalypse is what 40K is all about. I've had more fun with those huge games than with small games where you agonize over what you can and cannot field within your point values.)
You can combine anything except the red ones as per the above graph, doesn't matter if it's flufy or makes sense. Nor do you need permission.
Your allied detachment MUST take 1 HQ and 1 Troops choice and CAN take another Troop, Fast, Elite and Heavy Support.