Juventus, who returned to the elite competition after a two-year absence, face a tough test against Real in Group H.
The group also features UEFA Cup holders Zenit St Petersburg and Belarusian club BATE Borisov.
Last season's runners-up Chelsea will meet Serie A side Roma in Group A, which includes French club Bordeaux and Romania's CFR Cluj.
Champions League holders Manchester United are unlikely to face any difficulties in reaching the knockout stage.
They were drawn in Group E along with Spanish side Villarreal, Scotland's Glasgow Celtic and Aalborg of Denmark.
Bundesliga winners Bayern Munich will meet French champions Lyon and Italy's Fiorentina while Arsenal tackle Porto and Fenerbahce.
Spanish giants Barcelona have been handed a relatively easy draw as they will play Sporting Lisbon, Basel and Shakhtar Donetsk.
The full draw:
Group A: Chelsea, Roma, Bordeaux, CFR
Group B: Inter Milan, Werder Bremen, Panathinaikos, Anorthosis Famagusta
Group C: Barcelona, Sporting Lisbon, Basel, Shakhtar Donetsk
Group D: Liverpool, PSV Eindhoven, Marseille, Atletico Madrid
Group E: Manchester United, Villarreal, Celtic, Aab
Group F: Lyon, Bayern Munich, Steaua Bucharest, Fiorentina
Group G: Arsenal, Porto, Fenerbahce, Dynamo Kiev
Group H: Real Madrid, Juventus, Zenit St. Petersburg, BATE