Q:

How to decide the subject in this type of sentences?

The number of guests invited to the wedding is/are one thousand.

How to decide the subject in this type of sentences?

A:

In this exact construction, the only rationale choice is singular is. As @Jim comments, just pare it down... 

"The number of guests invited to the wedding is one thousand."
   "Can you repeat that please?"
   "The number of guests is one thousand."
   "I still didn't hear you. Once again, please?"
   "The number is one thousand."

Note: although "the number [of whatever]" invariably takes a singular verb form, "a number [of whatever]" normally takes the plural verb form...

A number of guests are planning to skip the actual ceremony and go straight to the reception party.

