I've seen them used interchangeably, but I was wondering if there is a significant difference.
“汉语” is a general scope of Chinese language, it is spoken in several countries including China. “普通话” is the modern name of “现代标准汉语”(Standard Chinese), it can be considered as the “official dialect” of “汉语”.
As you can see, the difference is the scope. Most Chinese speak “汉语”, but not all of them speak “普通话”.
中文 = 汉语 = （普通话 + other dialects of 汉语）
There 56 ethnic groups in China. 汉语 is the language of ethnic group 汉.
You ask a guy looks like a foreigner， "do you speak 汉语/中文?". Either is ok.
You ask a guy looks like from a different ethnic group, "do you speak 汉语?". Here 汉语 is more appropriate.
You ask a guy who looks really uneducated and speaks a weird dialect, "do you speak 普通话?"
Here's a pretty good rundown of the differences: https://www.yoyochinese.com/blog/Learn-Mandarin-Chinese-what%E2%80%99s-difference-between-zhongwen-hanyu-putonghua-guoyu-and-huayu