A few years ago I bought two large boxes of blank CDs in jewel cases. I use mine over a period of time, but my son who was a student did not use his immediately. When he came to use them, they had gone what is best described as "mouldy".
"Pre-recorded CD/DVDs" are created from a master and pressed - much like the old records were. Thus they are mechanically created, and are robust and with a long life.
Those you write yourself use a laser to cause chemical changes in a very thin layer within the CD. Moisture, heat, cold - all of these can affect them. Dual layer DVDs actually have two lasers that write at different depths. Experience and what I have read tends to suggest that just as floppy disks written on one machine were never guaranteed to read on another, so there may well be more variation on dual layer DVDs lading to less interchangeability.
I doubt that the CD or DVD drive you use to read the CD/DVDs in a few years time will be the one you wrote them in. Even now, you may have troubles - my desktop will only handle 4x DL DVDs as I discovered to my cost when I found that I had bought 2.4x DL DVDs. I had always assumed (wrongly it turns out) that a 4x drive would handle 2.4x disks, but not the other way around.
This leads to my rule number 1 - do not use the latest and least interchangeable technology for long term use, so I personally would not use DL DVDs.
You can buy archive quality CDs - they are more expensive. At the very least, buy from one of the companies that has manufactured computer storage media for decades. They have a quality and reputation to uphold.
This is my rule number 2 - for anything that is precious, use archive or high quality media.
I have a mantra that I repeat to all my customers - "there are two sorts of people - those who have lost data, and those who will".
This leads to my rule number 3 - always have two copies. However, don't make these two copies on identical media from the same batch. Use different ones. For example, with digital photos, every few weeks that you have taken them, as well as storing them on your hard disk, write them out to a CD. Then when you have about 6 CDs, put them onto a DVD, so that you now have two copies on different media.
I believe that the actual active layer is quite close to the top surface, and that you should only use special marker pens because standard ones contain solvents that might interact and affect the layer.
This leads to rule number 4 - only use special marker pens designed for CD/DVD use.
Now to my next rule - rule number 5. Store them in a place with relatively low humidity and a stable, reasonable temperature. Most equipment designed to play CDs and DVDs is going to be indoors (low humidity) where the tempertaure is a reasonably constant 20-22 degrees C (68-72 degrees F). If my understanding is correct, CDs and DVDs are actually built up of layers. Some of these layers will have different thermal coefficients, so the more temperature changes they are exposed to, and the greater those temperature ranges, the more thermal stress they will be exposed to. In turn, this can put stresses on the microscopic chemical changes that form your data. Now the data has been designed to deal with errors e.g. with CRC checks, but not with significant errors within the same area i.e. it may be able to correct one bit error in a byte, but not two. Excessive heat is probably bad, as it is mostly the heat caused by a laser that is used to cause the chemical change.
Finally, there is a second part to storage - what you store them in. I store mine in proper CD sleeves or cases. When I used to store photographic negatives, the better quality storage was special acid free paper/plastics. Because CD/DVDs are a similar process, I spend a little more and get quality sleeves. Then I keep them in a dark cupboard. After all, they are heat sensitive, and there is always the chance of sunlight passing through something that concentrates it - this is how fires start accidentally.
So rule number 6 is to keep them in the dark and in proper quality storage.
I have now dealt with the media and its storage. However, you can take a few precautions before creating the media. Make sure that you can read a disk written in your CD/DVD writer in a number of other machines. Do NOT utilise the modes some tools provide to squeeze on a few tracks extra of data. Some of these are outside the standard and may not be supported properly in the future.
And here is one that might suprise you - do not record your data onto CD/DVD with high level music blaring out. The vibrations may adversely affect your writer. (There is a video of someone singing loudly into the front of a RAID array in a data centre, and you can see that it causes all sorts of data errors, which the RAID corrects, but at a perfromance cost. Your data is being written without any of these benefits of redundancy).
If you are really worried, then it is worth every few years getting out your data and copying it onto new media. For example, copying your important data that you wrote onto CDs 5-10 years ago would only take 20% of the number of DVDs and you would know that it is still good.
Remember my mantra - "there are two sorts of people - those who have lost data and those who will". You can never totally prevent data loss, but you can do a lot to reduce the chances. Look at it another way - if you had to take it to a data recovery specialist, it would cost you thousands of dollars/euros/pounds. Against this, paying a few pennies/cents more for quality media, taking the time to check it and store it properly is probably a worthwhile investment.