Short answer
Islamic scholarship has discussed temporary contraception within marriage, including methods used historically to prevent pregnancy. Opinions can differ depending on the method, reason and circumstances.
Islamic Guidance
What Islam teaches
The classical discussion of 'azl demonstrates that temporary prevention of pregnancy was discussed among the Companions. Scholars have used this and other evidence when discussing permissible contraception.
Practical Guidance
What you can consider
Couples should distinguish temporary contraception from permanent sterilization and should seek qualified religious and medical advice when the circumstances are significant.
Sources
Sahih al-Bukhari, Book of Marriage; Sahih Muslim, Book of Marriage.