TL;DR
The pill slightly more effective than condom for contraception. Other methods are better still.
The pill is ineffective for preventing STI; condoms are mostly effective.
In Full
First things first. Statistics on contraception efficacy are widely available, so as a bonus you are getting info on several more types than just 'condom' and 'pill'.
How effective is contraception at preventing pregnancy?
Reported in percentages; take the percent away from 100 if you would prefer to know how many women in a hundred will fall pregnant despite using the contraception correctly.
Short-Acting
- male condoms: 98% (NB heavily dependent on effective / proper use)
- female condoms: 95%
- diaphragms: 92-96%
- caps: 92-96%
- COCP (combined oral contraceptive pill): >99%
- POP (progestogen-only pill): 99%
Long-active Reversible Contraception (LARC)
- contraceptive injection: >99%
- contraceptive implant: >99% (NB: over three years)
- IUS (intrauterine system): >99% (NB: over five years)
- IUD (intrauterine device): >99%
- contraceptive patch: >99%
- vaginal ring: >99%
'Permanent'
- female sterilisation: >99% (1 in 200)
- male sterilisation: > 99% (1 in 2000)
'Natural'
- natural family planning: ≤ 99% (ie up to 99%, depending on how closely it is followed)
(condoms and pills highlighted in bold)
Source: NHS contraception guide; from which the stats are liberally taken.
Note: The CDC also publishes a poster family planning methods. The percentages are the number of pregnancies per year (ie the opposite of the NHS published statistics). They also give actual effectiveness, rather than assuming correct use every time. For condoms in particular, this means only 82% effectiveness (vs 99%); and for the pill, 92% (vs >99%). There is further information available.
Although it isn't an 'accepted' source, there is a Wikipedia page with a table on contraceptive effectiveness; the more important part is in the references section of the article which has plenty of further reading.
How effective are condoms vs the pill for preventing STIs?
STIs need a method of entry to pass an infection from one host to another. Condoms, when used correctly, form a physical barrier preventing entry. The pill gives no barrier to entry.
I have yet to find a (reputable) source which claims that the pill gives any protection for STIs.
On the other hand, the CDC by itself has several resources on condom effectiveness at preventing STIS: