I understand that you only get your bonus offhand attack (or multiples with improved/greater feats) when using a full round attack. So my question is, if you're just making a standard action attack with your main-hand weapon, do you get the two-weapon penalty on your attack roll? Or does it only apply when you are making offhand attacks as well in the same round?
The penalty only applies if you are actively using the Two-Weapon Fighting option
Which you can only do as a full-attack.
What you have in your other hand (e.g. nothing, or Unarmed Strike, a shield, or a Shield Bash, a torch, or improvised weapon, or a knife as a light weapon) makes no difference to you unless you actively use the other weapon, and then only if you choose to activate Two-Weapon Fighting for the extra attack.
That’s the deal: +extra attack, −2 attack penalty. Note that if you have multiple attacks for some other reason (BAB +6 or higher, haste, etc.), you could use different weapons for each attack without penalty. You only take the penalty when you get extra attacks from two-weapon fighting.
No. If you're making a single attack, you do not take any two-weapon fighting related penalties.
It's the same thing as if you're using a sword & shield and only attack with the sword, even though technically you could attack with the shield as well, you don't take any penalties unless you actually do.