How can I transfer my iCloud contacts to my gmail ? Or my gmail to my iCloud so all my contacts are in one account
iCloud transfer contacts
iOSExport them in either one of those services. In iCloud on your desktop click on the settings wheel and choose export. Then import it in Gmail.
Export them how from my iPhone
You cannot do this from the iPhone natively, however, if you log into your iCloud account via a computer, you can easily export your contacts. Follow Apple's instructions via the following link. Afterwards, you can email the file to gmail account and import it. The native Mail app on the iPhone should allow you to import the file into your contacts, but I recommend you import it while logged into your gmail account via a computer.
https://support.apple.com/kb/PH3606?locale=en_US
Original thread: https://forums.imore.com/threads/icloud-transfer-contacts.338009/