I have recently made an extract amber ale from a recipe kit, after primary fermentation was done I bottled my beer for priming, the beer had a strong sour smell than but after searching online I assumed it's because the beer is still young. After another 2 weeks of priming I opened a bottle and it smelled sour, bet less so from bottling day, the beer tastes sour/tart. To my understanding this can either be from a wild yeast infection, or Acetaldehyde that will disappear in the future. How much time should I wait before I can safely assume it's an infection?
It is quite possible that a lactobacillius or other similar lactobacter has infected the beer. If the taste is not to your liking I would recommend leaving the beer for (say) another 6 weeks (or longer) in the bottle and re-tasting. After 3 months if it is still sour then it will not improve. Acetal (AKA acetaldehyde) which is usually associated with a tart or "green apple" taste is metabolised over time but lactic (or acetic) acid is generally not further metabolised. If the beer is TOO sour after 3 months then IMHO one might reject it (or allow it to make malt vinegar in an open container).
I have heard of some mad experiments to add bicarbonate to an unintentionally soured beer to drop the acidity. It can work if there is a very small amount of acid - otherwise it produces a flavour reminiscent of "salt and vinegar chips".
There's really not a set time for this senerio, but time and conditions may improve the beer.
Acetaldehyde is produced in early fermentation then later cleaned up in later stages and aging. It's identified by a green Apple aroma and in bad cases as a cidery taste. This may be the "sour" taste that reduced in the steps you mentioned. It may clean up in bottle conditioning and aging but may not as it's best cleaned up as a whole in a long secondary.
If it's a wild yeast time in bottle aging also may improve the beer but may take several months, or may even get worse.
My concern is that it may actually be acetobacter, which will only get more sour until oxygen or ethanol are gone. In which case it's usually game over for a brew.