restore database YourDatabase
from disk = 'C:\db.bak'
with
move 'YourDataFile' to 'D:\YourNewDir\YourNewDataFileName.mdf',
move 'YourLogFile' to 'D:\YourNewDir\YourNewLogFileName.ldf'
The above command will restore your database but move your database files to a different location as per your specifications. To get a list of database files contained in the backup (I just used the logical names of YourDataFile and YourLogFile), you can run the following command:
restore filelistonly
from disk = 'C:\db.bak'
If you want do to this through the GUI, then in the Restore Database dialog you can click on the item Files on the left, and you will see your database files listed. There are elipses buttons next to those file names, and you can click that to change the path. Likewise, you can just double click on the text box that has the file names themselves and change that to reflect the new path. Below is a screenshot of what I explained:
