The objective of playing offense is to capture the enemy flag, scoring your team points. Note, in order to capture the enemy flag, you must take it from their base all the way back to your base, and touch your flag stand while your flag is on it.
Offense players are also responsible for making sure the enemy's flag is on their flag stand for the minimum possible amount of time. Usually, one offense player will carry the enemy flag, and the other will wait at the enemy flag stand (called "camping") in order to take it again if the first offense either dies or captures it. The camper should also assist their chase when possible, though never letting the enemy get closer to the flag stand than them.
The offense player carrying the flag should run to your base as quickly as possible, since your base player will be able to support you in fighting the enemy chase. Using speed is crucial for offense, since split seconds matter, and a fast player is much harder to hit. Be prepared to be pulled a lot (force pull, which allows an enemy player to momentarily change your direction). Most flag carriers use light side force powers, and alternate between using force absorb (to avoid getting pulled into pits) and force protect (to avoid taking too much damage). With a fast enough base to provide team energize, these should make you difficult to kill. The flag carrier should also use speed when in their own base, and make the enemy chase chase them down - it's much easier to shoot behind you than ahead. Force seeing can also be very helpful in preemptively moving away from where the enemy chase is approaching. You should almost never self-kill while holding the flag, since it will instantly be returned. The only case is when the other offense is waiting on the enemy flag stand, with more of a health/force advantage than your positional advantage gives. If you happen to fall into a pit while carrying the flag, don't self-kill immediately, but instead notify your team by saying "get the flag" in team-chat, so your teammates can better position themselves to take the flag again quickly. Use wall-grabs to postpone falling into the pit as long as possible, even if it's not possible to jump all the way back out.
The camper, on the other hand, should try to use as little force as they can, so that you have enough left to turn on speed and run out of the enemy base in the event that the enemy flag does get returned. You need to be wary of the enemy base using force drain on you, which removes your force points and renders you much slower. If your chase has no trouble returning the flag, then make sure to stay very close to the flag stand. If, however, the enemy flag carrier proves to be difficult to get, it's good to assist them by dealing some damage to the enemy when possible. A useful tactic is to enable the team overlay view (\cg_drawTeamOverlay 1), which summarizes your teammates' health and powerups in the upper right corner. You can keep an eye on your flag carrier's heath, and if you see it suddenly start dropping, it's a good signal that it's time to get ready to get the flag. If your flag carrier says "get the flag" in team chat, that means that they are falling into a pit or will soon die, and need you to be ready to take the flag soon.
Here is a demonstration of a 4v4 CTF PUG match from the perspective of an offense player: