"by Sunday" means you will potentially arrive any day before or including Sunday from the time the sentence was said. So if the sentence was said on Wednesday, you could arrive on Thursday, Friday, Saturday or Sunday.
"on Sunday" means that is the specific day that you will arrive.
I would not say either sentence. To me the correct sentence would be
How long ago have you been here?