What happens to facebook and gmail accounts if one doesn’t use the

My friend deactivated his facebook account and was not using it for about two months but once he logged into his account again , he could start from where he left off. Is this the same for every social networking site or is there any duration of time when it will delete your account if not used like sim cards? If so what is the maximum period of time during which if an account is not used it gets deleted. And if such an account gets deleted where does the photos, messages and other data go? Do they get deleted permanently too?
