Mr Cameron said this at the Commonwealth Heads of Government meeting in Perth, Australia.
Mr Cameron’s threat applies only to one type of bilateral aid known as General Budget Support, and would not reduce the overall amount of aid to any one country.
Malawi already had some of its budget support suspended because it is refusing to acknowledge homosexuality.
The discussion in the Ugandan parliament of an Anti-homosexuality Bill in 2009 sparked controversy.
Nigeria’s senate is currently discussing a bill banning same-sex marriages that includes penalties for anyone witnessing or aiding a same-sex marriage.