Previous models of kleptoparasitism (resource stealing) assume that contests over resource items are of fixed duration. Here we suggest that such contests will often be well represented as a war of attrition, with the winner being the individual who is prepared to contest for the longer time. Given that time spent in contests cannot be used to search for other resource items, we provide an analytical expression for the evolutionarily stable distribution of contest times. This can be used to investigate the circumstances under which we would expect kleptoparasitism to evolve. In particular, we focus on situations where searching for conspecifics to kleptoparasitize can only be achieved at a cost of reduced resource discovery by other means; under such circumstances we show that kleptoparasitism is not evolutionarily stable.