It costs nothing after buying the game. Each chapter costs about the same as a normal new game that you buy, which for me would be about $50. Anet is planning 2 chapters per year, with chapter 3 due about the end of October.
It lasts as long as you want to play. PvP goes on forever, PvE as much as you want. I've been playing PvE with both chapters since May of 2005 and still have stuff to do, but I'm probably much slower than the average player.
Oh yeah, you can now pay $10 to add a character slot(s) to your game.
To Ranger808: The only actual cost is the initial price of the game, be it $30 US to $50 US or more. Just look around a bit, you can find it pretty cheap in a lot of places, and it doesn't matter what country you buy yours from. And, for a full retail key, there is no time limit at all what-so-ever. If you get a trial key, they last from 10 to 14 days, but grant full access. And, as for the client, you could download it now from their main web page at no charge if you really wanted to.
There's other costs, but all of them are optional, like additional chapters, extra character slots... not needed, but there if you want them.
If you're asking when they're going to discotinue service on the servers then I'd guess at the very least it would be 6 months to a year after the release of the final chapter. There is no forseeable "final chapter" yet, and I'm sure they'll make at least 5-6 chapters, maybe more, unless the game completely flops with the release of one of the chapters.
So basically, I'd say the truest and best answer to your question, if I'm understanding it correctly, is: Long enough.