The feature is available with Gboard version 1.42 and iPhones and iPads with iOS 9 and up. As you type, you'll find the translation in the suggestion strip or by pressing the Google button. The app automatically detects the language you're typing in and lets you then select which language you want to translate to. You'll also be able to paste text and translate it to or from any supported language.
In addition to the translation feature, Gboard has language support for 685 languages. To help people communicate in their first language, Gboard offers keyboard layouts tuned for each language, as well as autocorrect and predictive text features. Google has been steadily adding languages to Google Translate, and we can expect the feature to continue to grow on iOS.