Defining and Comparing multi(up to 12) byte variables

How to define that variable contains 12 bytes received from Serial?

So far I have done it by comparing data byte by byte but is it possible to define that variable equals 10 bytes and compare it with next one?

Your description is a bit hard to understand, but I think you want to read input from the serial port and test whether it matches a specific byte sequence. There are lots of different ways to do that. The most straight forward approach is to reach each byte as it becomes available, and buffer them to a char/byte array. You can compare the content of the buffer against a hard-coded value to see whether it matches. If the message consists of ascii text then that comparison can be done by a call to strcmp(). This sort of thing works best if you wait until the message is complete before you compare it. In the case of an ascii text message, you can look for the presence of a terminating character such as a linefeed to indicate the end of the message. Here is a simple example for ascii text messages to show you the idea:

// incomplete, untested
void handleSerial()
{
    const int BUFF_SIZE = 32; // make it big enough to hold your longest command
    static char buffer[BUFF_SIZE+1]; // +1 allows space for the null terminator
    static int length = 0; // number of characters currently in the buffer

    if(Serial.available())
    {
        char c = Serial.read();
        if((c == '\r') || (c == '\n'))
        {
            // end-of-line received
            if(length > 0)
            {
                handleReceivedMessage(buffer);
            }
            length = 0;
        }
        else
        {
            if(length < BUFF_SIZE)
            {
                buffer[length++] = c; // append the received character to the array
                buffer[length] = 0; // append the null terminator
            }
            else
            {
                // buffer full - discard the received character
            }
        }
    }
}

void handleReceivedMessage(char *msg)
{
	if(strcmp(msg, "on") == 0)
	{
		// handle the command "on"
	}
	else
	{
		// etc
	}
}