You don't get disconnected from the channel, but you can be kicked and/or banned from the channel for idleing too long.
This is usually monitored by a script on a bot that's in the channel all the time, and is on a channel-by-channel basis.
mIRC does have an option to rejoin channels when kicked in the Options menu.
The only way to prevent it, is to talk more, so that you don't get however much idle time in channel that is causing the script to kick you.
NOTE: Some scripts incorporate a small ban rather than just a kick in order to prevent people from automatically rejoining a channel when the are kicked, either via mIRC's option, or a script.