So why does Camilla get the title of Queen when she is not in the line of succession? Does she lose that title upon the eventual death of King Charles?
I am sure there are rules for that, but I don't know them.
In essence, it's an honorary title unless the Queen is the monarch through direct lineal descent (a King's daughter and/or heir) as was the case with Mary, Elizabeth I, Victoria, and Elizabeth II. As Queen, Camilla has virtually no power in the English Constitution because it defines the powers of the monarch. Similarly, Prince Phillip didn't have any real power because he wasn't the monarch; Elizabeth II was.
Prior to 973, the king's wife didn't have a title and wasn't part of the coronation. That changed with the coronation of King Edgar when his wife, Ælfthryth, was also crowned during his coronation, making her the first Queen of England and the first to wield substantial power and influence (it seems like she was a real frosty bitch, read up on her).
So, for over 1,000 years wives of British kings have generally given the title of queen, even though they are not part of the line of succession.
Given that Camilla isn't the mother of William, she likely won't be given the title of Queen Mother, but will just be Queen Dowager if Charles kicks the bucket first.