The above answers all assume that the desktop file is in /usr/share/applications, but sometimes it is not the case. So I posted my answer in case these answers do not work.
Usually when running the application or package you have installed, the icon of the application will appear in the launcher. That is to say, ubuntu has already automatically created a desktop file for the application. All you need to do is to find it and copy it to the desktop. More often than not it is in /usr/share/applications, as assumed by all other answers to this question, but sometimes it is in ~/.local/share/applications, or elsewhere you have no idea about. In the following I will add an icon for Qt Creator which is not in /usr/share/applications by default to the desktop to illustrate this method.
(1) After installation of Qt, run Qt Creator.
(2) Locate the path to the executable. This can be done by search the list of System Monitor in the Processes tab for the particular process for that application and view the process property.
(3) Record the path, say, /home/zh/Qt/Tools/QtCreator/bin/qtcreator
for Qt Creator. Search the disk for desktop file containing this path using command sudo find / -name "*.desktop"|xargs grep /home/zh/Qt/Tools/QtCreator/bin/qtcreator
. You will get "/home/zh/.local/share/applications/DigiaQt-qtcreator-community.desktop".
(4) Copy that desktop file to ~/Desktop, then you are all set.