No. It is not to do with tense.
I will finish the job in 5 days = it will take you 5 days to finish the job.
I will finish the job within 5 days = yes, by the 5th day, the job will be finished, but it may be finished sooner than that - the job will be finished within the time period of 5 days, so it could be 4 days or even 3.
within = inside the range of an area or boundary
The main tourist areas are within the city walls.
• inside the range of a specified action or perception
• not further off than (used with distances)
Bob lives within a few miles of his job.
• occurring inside a particular period of time
"The new product sold out within two hours."
"One-third of the prisoners were rearrested within two years of their release."
• inside the bounds set by a concept, argument, etc.
"I want to concentrate on the physiological data relating to stem-cell research Discussion of the ethics of this is not within the scope of my expertise."