Is the iPhone always using Wifi (instead of cellular data network) when connected?
No.
IPhone will use the cellular connection for push notifications at any time, unless
Settings > General > Network > Cellular Data
is turned off.
Also, if the lock screen is on, then iPhone is connected to the cellular network, not wifi.
IPad is always connected to wifi, lock screen or no.
I believe you cannot chose programmatically whether to use the WiFi or the cellular data connection.
If the iPhone has a WiFi network available, it will automatically use it, otherwise, it will fallback on the cellular data connection.