There are a few reasons that cause your photos to turn yellow and fade.
Some photographic papers are made of cellulose from trees. This type of paper can yellow over time when it comes in contact with certain acids that are in the air. The best way to stop this from happening is to keep your photographs in archival bins. If you photographs are mounted in a frame us a buffered matte. The buffered matte has a chemical in it that neutralizes the acid in the air.
When making your prints from a digital photo it is best to use archival paper. This type of paper is made from cotton instead of fibers from a tree. If you have a black and white photo you should wash the photo in PH neutral water for a couple of hours. Then follow up by toning the print with a selenium toner that will remove the acidic halides.
There are several reasons why color prints turn yellow over time. A normal C type print uses dye coupled silver halides. When the photograph is printed the silvers are rinsed away leaving the dyes on the photographic paper. No matter what you do all dyes will degrade over time. Since yellow dyes last the longest the photo will turn yellow.
Having your photographs turn yellow can be avoided by using pigment inks instead of dyes to print your photographs. Inkjet printers will work best as long as you use archival cotton paper. There is nothing that can be done to prevent dye photographs from color shifting over time, but you can slow the process down by using a UV glass if you will be framing the photograph.