While everything stated by Ray of Light's answer is correct, It is also worth noting that as a DM you should be looking at the player party to help determine when is appropriate for them to get better weapons.
If you are using a pre-made campaign and the party seems to be struggling on encounters they shouldn't, it may mean it is time for an upgrade. Certain groups may enjoy different levels of difficulty and restricting or increasing the quantity of magical equipment may be a good way to scale difficulty.
Another aspect you can look at for the level at which magic weapons can be obtained, would be to look at the required caster level to craft such a weapon.
Caster Level for Weapons: The caster level of a weapon with a special ability is given in the item description. For an item with only an enhancement bonus and no other abilities, the caster level is three times the enhancement bonus. If an item has both an enhancement bonus and a special ability, the higher of the two caster level requirements must be met.
This means a level 3 character could make a +1 weapon, a level 5 could make a +1 with a weapon ability such as Cruel but would have to be level 10 to make a Flaming weapon. Which also means that by the time they can make a flaming weapon, they can also make it a +3. So use this metric with a grain of salt.
You can also look at the bestiary, and see at what CR certain creatures get specific levels of DR. A creature with DR-/Magic would need at least a +1 or other special materials. where as creatures with DR-/adamantine would need a +4, and creatures with DR-/Alignment would need a +5. Again. These DRs are also overcome by specific tools, and heavily enchanted weapons are basically swiss army knives. A non-magic tool can be just as effective as well if your afraid of overpowering your party.