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.
The WIFI radio only stays on for a limited time (perhaps 10 to 30 minutes max) after the display locks (goes dark) to save battery power. This is usually done automatically by the OS, and not dependent on the last app run. If you want to avoid cellular data usage for longer periods of sleep, your best bet is to just turn off cellular data until after you wake up the device, when the device will turn back on power to the WIFI radio.