The 6ES7315-2AF01-0AB0 is a CPU 315-2DP, which has an MPI port an Profibus Port, Where as the 6ES7314-1AG14-0AB0 is a CPU 314 with only an MPI port.
If you are not using the Profibus port, then, yes, you can do the replacement, but a few extra steps need to be taken. If you are using Profibus, then no, you must use a 6ES7315-2AH14-0AB0 - and this CPU you can simply drag and drop on the old CPU.
1) Open the NetPro utility (you can double-click a network icon from Simatic Manager), and the highlight the CPU to see if it has any connections configured. If it does take notes or screenshots of the connections' properties. Also, check for Global Data (Tools -> Define Global Data, and take notes or a screenshot if necessary. Then close NetPro.
2) Open the HW Config, and double-click the CPU and again, take notes of the properties or screenshots.
3) Delete the CPU 315-2DP and replace it with the CPU 314. It will ask you if you want to delete the program as well, say no, and it will be separated in the project. Save & Compile and close the HW Config.
4) From Simatic Manager, copy and paste the separated Program folder back to the CPU. Drag and drop works too.
5) Open the HW Config again and re-enter the CPUs properties as they were before from your notes or screenshots.
6) Go back to Netpro and re-enter the connections' properties, if there were any, and set/check the Define Global Data, if any. Save & Complie.
7) Download everything to the CPU314 (you can highlight the station in SIMATIC Manager.