Due to a slight misunderstanding, Bob first called Chandler "Toby" while walking past him. At the time, Chandler was in a hurry to get somewhere and therefore unable to stop and correct him. Bob later asked if "Toby" wanted a doughnut and Chandler "wanted a doughnut", so answered to the name Toby and was afterwards too embarrassed to admit to Bob that his name was really Chandler. In "The One With Rachel's Date", Bob is about to get a promotion to Chandler's floor, but does not receive it because Chandler 'blocks' the promotion by talking to one of his bosses. He does this to avoid Bob finding out his real name, because this would be embarrassing.
Bob is disappointed when he learns he does not get the promotion, and wages a personal war against Chandler, the person who spoiled his chances. However, he still believes Chandler is called Toby, and asks for "Toby's" help to find the co-worker he thinks he has not met. Chandler plays along with this, even helping ruin his own office at the end of the episode.
It is never revealed what caused Bob to think that Chandler's name was "Toby" in the first place.