It depends upon the air freshener type and the ingredients it contains. Some air fresheners can cause paint to melt within a few hours, while others may take days or weeks.  The quality of the paint also plays a role in how quickly it will melt. This is why it's essential to carefully read the air fresheners' labels and choose one that is safe to use around the paint.