What kind of restrictions exist in windows phone 8.1 compared to the desktop OS, pertaining to execution of software? I've heard, for instance, that it's a hassle to run selfmade software. And, does everything have to be an "app", or would it run software which are .NET based (e.g. WinForms program), compiled with target "Any CPU"?
Windows Phone's only run apps that have been compiled either specifically for the phone (using a variant of Silverlight), or newer Universal apps that can also run on windows 8.1 devices.
Microsoft encourages people to write apps of their own, and there are a number of routes into this, with App Studio, and Visual Studio Express being available free of charge.
Restrictions in windows phone 8.1 vs. desktop windows 8.1
The best discussion I have seen related to restrictions and security architecture is Alan Meesus' Windows Phone: Security Deep Dive on Channel 9.
It covers a number of topics, from trusted boot to sandboxes to update policies. Platform architectures, like x86 vs ARM, and languages, like C++ vs C#, don't really don't matter much because the security architecture is consistent across the mobile platforms.
And, does everything have to be an "app", or would it run software which are .NET based (e.g. WinForms program), compiled with target "Any CPU"?
No. I had to port OpenSSL and Crypto++ to Windows RT and Windows Phone for a couple of projects. OpenSSL is C and Crypto++ is C++. (It was painful in some places, like Windows RT, because of the anemic APIs).