The TCP header is a lot more complex than UDP. It is flexibly sized between 20 and 40 bytes.

These are self-explanatory
Every byte of the TCP segment is labelled with a sequence number, and the one in the header is the number of the first byte in this packet. It's used for ordering the packets on arrival.
4-byte field containing the sequence number of the next expected segment. Used to check for out-of-order segments.
4-bit (half a byte) about the length of the TCP header. It's actually the number of 4-byte words in the header, since there are only 4 bits, so 16 possibilites.
Padding so that the header is a multiple of 4 bytes long.

These make up the 8 bits of flags in the middle of the header.
Used to acknowledge a previous segment that was recieved.
Reset flag. Immediately terminates a connection based on refused connections, confusion, or crashes.
Synchronization flag initiates a connection with a new host.
Terminates a connection normally.
Congestion window reduced and Explicit Congestion Notification are used to handle congestion.
Short for push. Used to stop the receiving end from bundling messages together before handing them to the application layer. The PSH flag will force the receiving TCP handler to flush the buffer after the message arrives.
Marks a message as urgent, so that it is processed first on the host. An example if it being useful is for cancelling a file transfer.
This is the remaining size of the aforementioned buffer. It is used to let the sender know how much space is currently left in the buffer, and is used for flow control.
Standard checksum
Used to point at the byte which contains the urgent data, since one segment can send both urgent and non-urgent data. Irrelevant if the urgent flag is not set.
An extra 40 bytes to implement other things that are not supported by the stock header. A timestamp is an example of something in this section.