Actually 일주일 means one week, so it has different meaning from 주일.
주일 means week from Monday to Sunday (but I believe not many people say "주일", but "주" instead.
So, they are not really interchangeable.
For example, when you want to say as following,
-The last week of this month, 이번달의 마지막 주(주일)
- One week, 일주일
- Two weeks later, 2주일(주) 후
But 주일 is also regarded as Sunday in Christianity.
- Going to a church 주일에 교회에 가다.
Hope this may help you!