The disciples had been praying to Jesus. Three times Jesus left them to pray himself, and then returned. The disciples continued to pray. At this point, Jesus has work to do, and must begin teaching the lessons of the day. He tells them to cease praying. However, lest his intent be misunderstood, he told them that they should not cease to pray in their hearts.
There are times when we are in the formal attitude of prayer, as were the disciples. It can be an intense experience, and even with a private effect, there are times when it is appropriate in public. Nonetheless, just as Jesus had work to do, so do we. There are times when we cannot be in the formal attitude of prayer. Nevertheless, the things we think about, the way we treat others, the attitudes that we express, can all witness to an internal prayer that we can carry with us always.