A lot here depends upon how much they are different in size. Choosing a low % agarose gel - say 0.8% and run it for as long as possible can help.
There's an old trick extracting DNA from a gel of cutting the gel and inserting a piece of 3MM filter paper into it and then run the gel a bit more. The DNA will run into the paper, and can the be removed - either for cloning or discarding depending on whether it's the shorter or longer band you want.
You still might have some of the unwanted band but in a much lower proportion.So your sub-cloning should generate a high proportion of the clone you want.
Another thing to consider is why you are getting two bands. Is it a PCR optimisation question, where you are getting miss-priming; or is it a target question, where you have a heterogeneous target sequence.
The main difference of these bands should be the size. Try with an agarose gel of less %, in order to differenciate the migration of the bands. Another suggestion if your bands are of the same size (or very similar) is try to adjust your PCR conditions (anneling temperature, enzyme, buffer, amplification system, ect) in order to avoid the amplification of the contaminant band (the other gene that you not need to separate of the gel).
another possibility similar to the above is to insert a DE cellulose filter between the bands and the larger band will stick to it . Alternatively run for a long time in cold conditions and low voltage to minimise thermal band broadening and either excise the band or sample the correct band with a pipette tip and re-amplify. Possible also is sampling the correct band and re-amplify with internally nested primers.
Maybe since you know the sequence of the correct band choose a couple of restriction enzymes that do not cut the wanted band adn hope one of them cuts the unwanted band. Common cutters would be best.
Amplify the usual way and cut the product and if the unwanted amplimer has cut then the unwanted fragments will be smaller and better resolved.
If you annealed your pcr at a higher temperatuyre or used DMSO in the pcr mix you might aliminate the unwanted product as would using different primers if that is possible
Don't put a lot of effort in separation. Just clone both fragments and check the cloned fragments with an internal restriction site (you know the sequence?). Screen some more clones by p-DNA isolation and restriction analysis.
I agree with the above suggestions, but, if you have restrictions to clone fragments, you can try: Make a gel with a lower agarose %, Use a lower voltage (even, during the run, you can reduce it again), and Let the run as much as possible.