I have heard some debate whether he was 13 or 17 and curious about sources for this age
16 When the chief baker saw that Joseph had given a favorable interpretation, he said to Joseph, “I too had a dream: On my head were three baskets of bread. a 17In the top basket were all kinds of baked goods for Pharaoh, but the birds were eating them out of the basket on my head.”
18“This is what it means,” Joseph said. “The three baskets are three days. 19Within three days Pharaoh will lift off your head and impale your body on a pole. And the birds will eat away your flesh.”
20Now the third day was Pharaoh’s birthday, and he gave a feast for all his officials. He lifted up the heads of the chief cupbearer and the chief baker in the presence of his officials: 21He restored the chief cupbearer to his position, so that he once again put the cup into Pharaoh’s hand— 22but he impaled the chief baker, just as Joseph had said to them in his interpretation.
23The chief cupbearer, however, did not remember Joseph; he forgot him.
Genesis 41:1 When two full years had passed, Pharaoh had a dream: He was standing by the Nile.
Genesis 41:46 Joseph was thirty years old when he entered the service of Pharaoh king of Egypt.
When he met the chief baker in prison, he was
30 - 2 = 28 years old.
I don't know the exact age of Joseph when he first arrived at Egypt. But it is likely to be closer to 17 than 28 as mentioned in Ozzie's answer. My guess is 19. I'm sure that more research can achieve a better estimate.
How old was Joseph when he was sold into slavery?
Joseph was 17 years of age.
Genesis 37:1-3 (NASB)
1 Now Jacob lived in the land [a]where his father had sojourned, in the land of Canaan. 2 These are the records of the generations of Jacob. Joseph, when seventeen years of age, was pasturing the flock with his brothers while he was still a youth, along with the sons of Bilhah and the sons of Zilpah, his father’s wives. And Joseph brought back a bad report about them to their father. 3 Now Israel loved Joseph more than all his sons, because he was the son of his old age; and he made him a [b]varicolored tunic.
There are several dates that give chronological information about Joseph:
- Joseph 17 when he had the first two dreams, Gen 37:2
- Joseph sold into slavery in Egypt to Potiphar, Gen 37
- Joseph works in Potiphar's house but later jailed, Gen 39
- Joseph interprets two dreams by the cupbearer and the baker, two years before Pharaoh's dreams, Gen 40, Gen 41:1. Therefore, Joseph is 28 years old.
- Joseph 30 at the time he enters Pharaoh's service, Gen 41:46.
- Joseph supervises the collection of grain during the seven years of plenty
- Joseph meets his brothers during the second year of famine, he is presumably, 39 years old. Gen 45:6.
- Joseph 110 years old when he dies, 50:22, 26