Hey Hamid,
Both sound gramatically correct to me, but I think there's a very slight difference between the two.
1. "I was exhausted at the end of the day."
This just sounds like you were tired at the end of the day.
2. "I was exhausted by the end of the day."
This sounds like you had a busy day, like helping a friend move or going to classes.
Good question! Hope my answer helps a little bit.