By default, the iPhone will download the last 3 rolling days of messages to the phone for viewing. Older messages are not deleted from the server, they are just not visible. The 3 day default can be changed to up to 1 month. POP/IMAP: Deleted messages are removed after 1 week by default (adjustable to up to never).