Is it possible to hack android phone by contacting the target over Gmail or Skype, if the target does not downloads suspicious files sent over? In other words, how safe is having Gmail or Skype conversations with complete strangers on android? Suppose the target is wise enough to not open any suspicious files sent to him. How else could his phone be hacked?

I have heard that it is possible to know the ip address of the sender on Skype. But a cyber criminal knowing your ip address is the same as a burglar knowing your address. The information is necessary but not immediately sufficient.

Also, which, between Skype and Gmail is safer for the user in these cases? I guess Gmail is safer, but don't know why and by what amount. Also, how exactly does the danger increas for users using old version of the android- like 5.1 or 4.4.2, let's say? I guess the older the version, more the risks.

Sorry for sounding paranoid, but one is afraid of things one does not understands, they say. Thanks for helping...
Android Apps are sandboxed. If someone can "hack" skype, they may be able to get data from the skype app, possibly including contact list, login credentials and chatlogs. Further they may get everything, what the skype app can access, which probably includes the phone's address book as well.

If your phone has a remotely accessible flaw, which would be a reason for the fear that somebody could get your ip address, you have bigger problems than your skype contacts and should upgrade your android ASAP. Further, modern skype isn't peer to peer anymore but a skype server is used. Finally your phone will be most the time firewalled in your LAN or in cellular networks because of CGNAT. Which may be false security, i.e. if somebody is in the same WLAN like you. 

I am not aware of any remote security flaws in android, but there are many local ones in older android versions, including ones triggered by special image files (which could be sent via skype) and similiar attack vectors.