There diferent aproaches to answer your question.
##1) On a already generated image, like a photo from a camera##
The ppi info on a image file is just a tiny little number inside the file. It is only meaningfull when you are thinking on printing the file. It answers just a question. "Of thoose pixels you already have in your photo, how many you need on each phisical inch?"
This produces diferent size in the printed result.
"I want you to use 300 ppi on each inch" or "No I want a bigger print, just use now 150 on each inch" This will make twice bigger print.
In both cases your original photo is exaclty the same.
##2) Before making a file on a raster image program##
If you create a new file on a program like Photoshop and you define it terms of pixels, you just have the previus case.
But if you define a new file in terms of a phisical dimension, for example a 8x10" image. The number you use on ppi affects the real file size.
If you define this 8x10" with 300 ppi you have a file (8x300)x(10x300) = 2400x3000 px.
But if you use 150 ppi you just have a (8x150)x(10x150) = 1200x1500px.
##3) Wich aproach should you use?##
In general terms I recomend defining a file in px, that way you can work on a file that you can handle, for example a digital paint. Some people thinks that if they just use a higher ppi they will get a higher quality, but sometimes they sacrifice the performance ofy big file, for example ona billboard.
In this post I posted some graphs regarding this issue: