One of the sources for this statement is in Ma'amar 2, towards the end of Chapter 30 of
Rabbi Yosef Albo's Sefer Ha'ikrim. It is brought in the name of the "chacham" - "wise person."
אי אפשר שישיג עצמותו שום נמצא זולתו. כמו שאמר החכם כששאלו אותו אם היה יודע מהות האל, והשיב: אילו ידעתיו הייתיו. כלומר כי אין מי שישיג עצמותו אלא הוא יתברך, עם היות מציאותו נגלית מצד מעשיו תכלית ההיגלות.
My rough translation
It is impossible to understand Gods essence (the aspect of God that is independent of the world, and does not conform to the conditions of our reality). Just as the wise person (chacham) responded to those who asked if he knew God's essence, "If I knew him, I would be him." This means to say that no one can understand God's essence, even though his existence is revealed through His actions.
See this article for a very well written up, in Hebrew, explanation of this concept. The article mentions how sifrei Chassidus take this concept deeper by explaining that if one understands God, one connects with God and becomes "bateil," nullified (for lack of a better term), in relation to Him.
EDIT: Their seems to be earlier sources regarding this phrase, see Fred's comments (1, 2) to the question, of which the Ran seems to be the earliest source.