By default the two variables are not defined in your configuration files.
(There also might be a my.cnf configuration file.)
You can see (most) of the MySQL variables when you do a,
show variables;
within mysql.
One problem is that 'wait_timeout' is really
'interactive_timeout' when you do a 'show variables' within
mysql.
I believe wait_timeout and interactive_timeout are both, by
default, set to 8 hours (28,800 seconds). Normally 8 hours is
too long for most programs, but in your case it might make
sense to increase the values. It's worth a try at least.
You should read the MySQL manual about what it says about these
variables, and then decide whether you want to make the
additions to the my.ini file (within the [mysqld] block) and restart the mysql daemon.
But, yes, if you don't have a huge number of connections
being created all the time you could try this for a couple
of days and see if it solves your problem.
If you always get database activity within 8 hours, however,
then resetting these variables will not help you (they might
even hurt by gobbling up more RAM and threads). If there is
a span of more than 8 hours (e.g. overnight) when the DB
connection has no activity, then you should either increase
these variables or rewrite your application to handle
dropped connections gracefully.