Question: how many years did it take joseph to become prime minister?
Answer: According to Pirqei deRebi Eliezer §39, Joseph was in prison for ten years, meaning that he was 20 years of age when he was denounced, having served Potiphar for three years altogether.