The difference reflects the gender of the noun it's describing. If you're talking about a (singular) neuter noun - hus, bilde, dyr, it has to be pent.
et pent hus, et pent bilde, et pent dyr
If you're describing a singular feminine or masculine noun, it's pen.
ei pen jente, en pen bil, en pen invitasjon
There's also pene, which is used for plurals, regardless of a noun's gender.
De er pene hus. (They pretty houses.)
De er pene invitasjoner. (They are pretty invitations.)
Invitasjonene er pene. (The invitations are pretty.)