The comma would end up between but and orange.
"You may have an apple or an orange, but you can't have both."
This is because you're coming to a conjunction, which usually has a comma preceding, or coming before, it.
Between the or and apple and also the orange and but
The correct placement of commas in the sentence is before "but," resulting in: "You may have an apple or an orange, but you can't have both." This comma indicates the separation between the two independent clauses clearly. No other commas are necessary in this sentence.
;