This is the most critical distinction for learners.
争论 (zhēnglùn) is a debate of ideas. It's about who is right based on logic, facts, or opinion. It can be calm or heated, but the focus is the topic.
吵架 (chǎojià) is a clash of emotions. It's a quarrel or fight, often loud, personal, and angry. It's about venting frustration, not proving a logical point.
Correct: 我们可以争论一下,但不要吵架。(Wǒmen kěyǐ zhēnglùn yīxià, dàn bùyào chǎojià.) - “We can debate a bit, but let's not fight.”
Incorrect: 他因为我忘了他的生日,和我争论了很久。 (He argued (topic) with me for a long time because I forgot his birthday.) This is wrong because the reason is emotional.
Corrected: 他因为我忘了他的生日,和我吵了一架。(Tā yīnwèi wǒ wàngle tā de shēngrì, hé wǒ chǎo le yī jià.) - “He had a fight with me because I forgot his birthday.”