You'll get the password to the first portrait just after your first Potions Class. You'll get your second Portrait shortcut on your way to your first Quidditch Practice, it will be in the bottom floor of the Clock Tower. The third will come on your way to your first Quidditch game and will be near the Quidditch field. Number four will come after going back to the Burrow and defeating Bellatrix and Fenrir, and will be located in the Library. The last portrait will come after talking to McGonagall and joining the Ravenclaw dueling club, and is located in the Transfiguration Courtyard. Just use each portrait and this achievement is yours.
Note: that you have to actually go through each one, not just open the portrait.