The Catholic Church believes Jesus instituted the Church when he made the pronouncement in Matthew 16:18. Do you know what year that was?
Among the Fathers and early Christian writers, it is held that Jesus was born around 2-3BC and that he started his ministry the same year as St John the Baptist. This was around AD 29, which according to Luke 3:1, was in the fifteenth year of the reign of Tiberius.
Most of what St Matthew wrote was focused mainly on Jesus’ first year of ministry. In Chapter One, he talks about his genealogy, the magi, and flight to Egypt in two. Then in chapter 3, he talks about John’s preaching, Jesus’ temptation, his announcement in the synagogue, the calling of his Apostles, and his first teachings leading to the Sermon on the Mount. All early in his ministry.
Still early in his ministry, he calls St Mathew in chapter 9, and by chapter 12, all the apostles were already called and given the power to minister to others. In 11, John is still alive, but by 14, Jesus found that he had been killed, which means it was a recent occurrence. This is because, according to Mark and Luke, his death happened early in Christ’s ministry. So from all of these, we can safely believe his ministry began around AD 30 or 31 at the latest. Since judging from the timelines above, it is safe to say the promise of the keys happened early in his ministry.