Hi!
Why does the Error Message in your screenshot not read the same as the one in your Title?
The error in your screenshot occurs when you select the parent of an object first, then the object itself and use the parent shortcut (P).
The error in your title occurs whenever you try to execute a command that needs two or more selected objects but you have only one selected. For example, creating deformers, constraining objects or parenting an object.
Could it be that you are trying to use P to extend your timeline because this shortcut does this in another program you are using?
As far as I know Maya doesn't have a default shortcut to extend the timeline. But simply selecting the number of frames on the right side of the timeline and typing in a higher number should do it without a problem.
I hope this helps!