Is wifi on when the iPhone is idle? I have an iPhone 5 with iOS 6.0.1. Whenever I resume the phone from idle, I see "LTE" quickly change to the wifi icon in the status bar. This makes me believe that wifi is off when the phone is idle. Is this also true when I have Pandora playing music and I power off the screen? I have a limited data plan and would like wifi to be on when the screen is off.
In general, it's up to the App to detect and decide not to use cellular data over Wi-Fi data and you are correct, that in absence of a process actively using Wi-Fi - it goes asleep. Even if the app prefers Wi-Fi - there can be a burp where it drops signal or sync with the base station and falls over onto cellular.

You can test an app quite easily by pulling the SIM card and seeing how it behaves as the device goes to sleep. I don't use pandora - but most apps that stream also have a setting to avoid cellular usage if they don't pause the stream when a networking change is detected.