Once this month's transfer window closes, the La Liga clubs will blocked from signing new players until summer 2017 but will still be able to sell players.
Football's governing body will block the two European giants from registering any new players for two consecutive transfer windows, after it found them to have violated rules relating to the transfer of players under the age of 18.
Both teams now have only the two weeks remaining of the current transfer window to buy new players before being shut out of the market for 18 months, but could follow rivals Barcelona in attempting to delay the punishment by appealing the decision.
After being handed a transfer ban for similar offences in April 2014, Barcelona took the case to the Court of Arbitration for Sport (CAS) - who dismissed their appeal - enabling them to sign Luis Suarez from Liverpool for £75m that summer.
In a statement Fifa said:
The two clubs were found to have violated several provisions concerning the international transfer and first registration of minor players as well as other relevant provisions with regard to the registration and participation of certain players in competitions.
In addition to the transfer bans, Fifa has fined Real Madrid and Atletico Madrid roughly £620,000 and £250,000 respectively.