Forrest Gump is a 1994 American epic romantic-comedy-drama film based on the 1986 novel of the same name by Winston Groom. In this film, the following words are used by the lead character Forrest Gump (played by Tom Hanks), "Mama always said life was like a box of chocolates. You never know what you're gonna get."

With this quote, it is believed that Forrest Gump is using it to exemplify the randomness of life. Throughout the novel and movie, he is involved in several historically significant events, often by chance. Life is random; a person will ever know what's going to happen until it actually happens. Basically, the quote says life is random.

More Info: en.wiktionary.org