It depends. For the most part, horses are perfectly fine with the barn cat. (Cats, on the other hand, seem to like horses for some reason. Or maybe they just like the way the grain attracts mice). Most horses will tolerate having a cat jump onto or sit on their back - the cat, after all, is a lot lighter than a human rider.
However, horses will sometimes get annoyed with cats. I know one who was so mad with a cat for jumping onto his back (While I was riding him so I wasn't exactly pleased with kitty either) that he glared at it and bared his teeth every time he saw it until the cat (which belonged to an employee) moved out. He never did forgive that cat.
Most of the time, though, they get on.