According to Luke 3:1, John the Baptist began his ministry in the fifteenth year of Tiberius Caesar’s reign. Tiberius was appointed emperor in AD 14, and “in the fifteenth year“ would be AD 28 or 29. Jesus began His ministry shortly thereafter, so, around AD 29. As for the end of His ministry, we know that it culminated with His crucifixion, resurrection, and ascension.
According to John’s Gospel, Jesus attended at least three annual Feasts of Passover through the course of His ministry: one in John 2:13, another in 6:4, and then the Passover of His crucifixion in 11:55–57. Just based on that information, Jesus’ ministry lasted 2 years, at the very least.
Because of the amount of things that Jesus accomplished and the places He traveled during His ministry, many scholars believe there was another Passover, not mentioned in the Gospels, which fell between the Passovers of John 2 and John 6. This would lengthen Jesus’ ministry to at least 3 years.
We can add more time because of all that took place before the first Passover of Jesus’ ministry in John 2. By the time of that first Passover (in the spring of 30), Jesus had already traveled from the area of the Jordan to Cana to Capernaum to Jerusalem. He had been baptized by John (Matthew 3:13–17), been tempted in the wilderness (Matthew 4:1–2), began His preaching ministry (Matthew 4:17), called His first disciples (John 1:35–51), performed His first miracle (John 2:1–11), and made a trip to Capernaum with His family (John 2:12). All this would have taken several months, at least.
Add to that the 40 days between Jesus’ resurrection and His ascension (Acts 1:3), and we have a total length of Jesus’ earthly ministry. From His baptism to His ascension, the late summer of 29 to the spring of 33, we have approximately 3½ years.