I think ตอนไหน is more about what time of the day you are going to do something. For example, จะโทรมาตอนไหน when will you call ? answer : ตอนเย็น In the late afternoon. เมื่อไหร่ is used interchangeably, but there is a sense of a larger time span, it can be years , weeks, etc. For example, จะมากรุงเทพเมื่อไหร่ when will you come to Bangkok ? answer : ปีหน้า next year