Pill and sex

Okay so say I had sex then didn't have sex for a month and then forgot to take my pill could you get pregnant for missing it that late after having sex? And if not how long after having sex can you miss the pill?