'In twenty years' denotes something in the future, eg 'in twenty years time', while using the definitive article 'the' in 'in the twenty years' would be used as a specific reference to a twenty year period that has happened.
Example 1. In twenty years I will be rich. ie; I will be rich in twenty years time.
Example 2. I have never seen that in the twenty years that I have worked here. ie; I have worked here for twenty years now and have never seen that in that specific period of time.
- For Teachers