“to enjoy them.” The literal Hebrew is to “eat of them,” but in the culture, a major way of enjoying riches was to eat the good food that riches could buy, so “eat” was often used for “enjoy.”
“to accept his portion.” Life is unpredictable and difficult. This should not catch us off guard, because Scripture is clear that we live in a fallen world, there are many evil people, and the Devil controls much of what happens (1 John 5:19). But in spite of that, many people somehow expect life to be easy and wonderful, and are angry when it is not (Ecc. 5:17). To live a peaceful, joyful life, we must be honest about the fact that this life will be difficult; and we have to have a clear hope in what will certainly be a wonderful future life.
The translation “accept his portion” or equivalents points out that a key to leading a peaceful life is to accept what comes up in life and not constantly be fighting it (cp. CEB; ESV; GWN; NIV; NLT; NRSV; RSV; R. Belcher, Ecclesiastes, A Mentor Commentary; D. Garrett, The New American Commentary).
“this is the gift of God.” This also occurs in Ecclesiastes 3:13 (see commentary on Ecc. 3:13).