On linux, well CentOS at least, you would edit /etc/my.cnf and add the same text as randy melder says. There is likely to already be [mysqld] in my.cnf so you just need to add the second line: max_allowed_packet=16M
It's important that this line is somewhere under [mysqld] not another  header in this file as the setting won't be picked up.
You would then need to restart the MySQL server (mysqld) as otherwise it won't know about your change since it only reads /etc/my.cnf when it starts up. Restarting mysqld forces it to re-read my.cnf and pick up your change.
To restart mysqld:
Why would you want to increase your packet size? One top reason is if you are importing a large MySQL database in the form of a plain text file, e.g. using this command
mysql -u username -p -h localhost databasename < data.sql
Reasons for this are for example if you are moving databases between servers or restoring a database from a backup. Or if your file size is too large for another method, e.g. import via phpmyadmin
These mysql database export dump plain text files can get large in the order of several 10s of Mb and the default packet size setting can be quite small relatively in comparison.
With that default setting you might not be able to do the import and you would therefore be presented with the error message: "ERROR 1153 (08S01) at line 53: Got a packet bigger than 'max_allowed_packet' bytes".
So setting max_allowed_packet as described in the answer above can cure that problem, provided your setting is larger than the file you want to import.