It’s rather trivial task for people who use Ubuntu for a long time but newbies usually have problems with adding program to startup if location of the program is unknown or it is required to specify full path to the program somewhere e.g. when opening attachment in mail client. There are two most popular ways to find this out:
1. which gedit
2. type gedit
Both will show full path to certain program (gnome editor in our example): /usr/bin/gedit: