I am really confused about software linceses, I've read a lot of articles but I can't find an answer to my question, which is: Can I develop and sell applications that uses libraries under gpl license? Like for instance, I want to use agsXMPP library in a windows phone app, and sell it in the market, so is it legal?
Stop reading articles, and read the actual GPL itself. It's not that hard.
Yes, you can sell applications. But if someone who receives an application asks for it, then you have to give them all the source code for anything that includes code licenced under the GPL.
Your question is easily answered. Just read the FSF FAQ on the GPL. I linked to the FAQ that directly answers your question.
Does the GPL allow me to sell copies of the program for money?
Yes, the GPL allows everyone to do this. The right to sell copies is part of the definition of free software. Except in one special situation, there is no limit on what price you can charge. (The one exception is the required written offer to provide source code that must accompany binary-only release.)