I am new to Ubuntu and I am really interested in making software that can work on it and I would like to make profit from these software.
How can I make money from making software for Ubuntu if the programs are open-source and free ?
Ubuntu, being a free and open source OS, does not limit you to the usage of free (as in freedom, not as in free beer, to quote Richard Stallman) software only. If you take a look into the Ubuntu Software Center, you'll find a bunch of proprietary software, some of which you have to pay money for. Another example is Steam, which allows users to sell games for Linux.
So you can make and deploy proprietary and paid software for Linux. There is no contradiction in that.
If you want to make your software free as in freedom, you could charge for it too, but it wouldn't make the most sense, as anyone who has the software and its code may remove any copy protection and redistribute it legally. Another way would be to raise donations.
There are, however, some successful business models which are based on free software, but I can't think of any example where the customer pays for the software. Most of the times, you pay for exclusive support, such as in the example of Canonical, who offers paid support for business customers. Some companies may offer other services, but I think I've made my point.
The open source effort itself rarely makes much money. Donations perhaps. However, open source can be made to create an environment which is conducive to profit nearby. Most "for profit" work with open source consists of trying to create a symbiotic relationship between your profit generating venture and the open source community.
Red hat is an excelent example of this relationship. They provide quite a lot of feedback to the Linux community, but their profits come from providing Linux related services to large corporations.
One can also look to the relationship between python and Guido von Rossum's employers
Do make sure your heart is in the right place. If you want to make open source software, and seek to earn a living at it, you will find opportunity everywhere. If the wording is slightly different, and instead you seek to make profit, but want to use open source to do it, you will find more profitable approaches elsewhere.