Event count versus complete repetition
次 is a neutral event counter. 去过日本三次 means I went to Japan on three separate occasions; the word says nothing about how long each trip lasted. 遍 carries the extra meaning of "from start to finish, completely". 把这本书读了三遍 means I read the entire book three times through, not merely picked it up three times. Learners default to 次 because it matches English "times" more closely; 遍 is the word you need when completeness matters.
这部电影我看过两次,只完整看过一遍。
Zhè bù diànyǐng wǒ kàn guo liǎng cì, zhǐ wánzhěng kàn guo yí biàn.
I have seen this movie twice, but I have only watched it all the way through once.
Verbs that typically take 遍
Verbs describing processes with a clear start and end favor 遍: 读 (read), 看 (watch), 听 (listen), 说 (say), 讲 (tell), 写 (write), 抄 (copy), 检查 (check). Teachers commonly say 再说一遍 (say it once more, completely) when they want you to repeat the whole phrase, not just ask again. 再说一次 would also work but could mean "say something on the topic one more time" rather than "repeat the exact sentence".
Verbs that prefer 次
Verbs marking discrete events or visits default to 次: 去 (go), 来 (come), 参加 (attend), 打电话 (make a call), 见面 (meet). 去过北京三次 (been to Beijing three times) uses 次 because each visit is a countable event. 去过北京三遍 sounds wrong; there is no start-to-end process being repeated on a single visit. Sports and games also use 次: 打了两次 (played twice).
我给他打了三次电话,他都没接。
Wǒ gěi tā dǎ le sān cì diànhuà, tā dōu méi jiē.
I called him three times; he did not answer any of them.
Nuance: incomplete reading
遍 implies completion. If you read half the book three times, you read it 三次 but not 三遍. The precision of 遍 matters in academic and instructional contexts where teachers track whether students covered the whole material. In casual speech, 次 is often used where 遍 would be more precise, and native speakers will understand; but using 遍 correctly sounds more educated and careful.