A temporary dental filling typically lasts a few weeks to a few months. It should be replaced with a permanent filling as soon as possible.