Personally I wouldn't like it if someone says this to me.
But you clearly also don't like it when they keep going on and on without actually saying/asking what they want. So it's fine if you don't come across as really friendly with that one sentence. Just make sure to react possitively when they actually condence their point after your remark.
On when and how to tell them I would make a difference whether they're trying to ask a question or when it's really just an interesting story that keeps draging on.
real question
Just interrupt, possibly with something like: "and what is your question?". It's better to interrupt early and do so with a big smile on your face.
It's possible they're trying to ask something where they're afraid of your answer and are just trying to postpone that moment a bit. In this case just "help" them by interrupting with "And what exactly are you asking now?" or something similar. (Again, big smile, possitive mood).
story telling
Depends a bit on your usual interactions. You may want to let them finish the story and suppress your annoyance. Or you can interrupt shortly with "it's too interesting speed it up a little 'cause I wanne know how it ends!". Try to keep it light hearted so the mood stays possitive.
If it happens often you may want to talk with your friend about it taking so long. It will be a bit awkward depending on how you word it but if it's a real friend and you show you're still interested in what he has to say, as long as he tries to come to a point faster, then he shouldn't feel too bad about it. In the end it will probably make both of you happier since he can still talk about all his stuff with you while actually getting a better response from you.