max_allowed_packet after mysql restart
Setting in the command line are not persisted anywhere. Therefore after a restart it resets to default or picks up the value from the config file. 

Put the following line into your my.cnf file under the [mysqld] section:

max_allowed_packet = 16777216


About how to find what file is used you can find some resources here on stack exchange as well:

https://stackoverflow.com/questions/2482234/how-to-know-mysql-my-cnf-location