I assume that this is a regular PVC pipe and not some special fitting like the P-trap.
If you are lucky you can cut the broken piece off square and glue on a coupling or appropriate fitting. You should plan the whole connection to the sink/disposer before you glue anything on because space may be at a premium.
If the break is close to the wall, you need to be sure there is enough pipe to glue the fitting to.
If the break is flush with the wall or slightly recessed, you will need to remove some material around the pipe to accommodate the diameter of the fitting and get access to clean the pipe and apply cement.
If the pipe is cracked back to the next fitting but not broken off you may be able to salvage it as follows:
1. Get a "Schedule 40" coupling (not DWV) of the correct size. You can usually get Schedule 40 up to 1 1/4" at HD. Most local hardware stores won't know what Schedule 40 is.
2. Cut off the ragged end of the break so it is just about 1/8" shorter than the depth of the socket in the coupling. You may need something like a Dremel tool if there is no space for a hacksaw.
3. Clean the area back to the fitting with primer/cleaner, and prime the coupling.
4. Apply a liberal coating of PVC cement to both the coupling and the stub, and the face of the mating fitting.
5. Push the coupling onto the pipe and give it a 1/4 turn while pushing it against the old fitting. HOLD IT IN PLACE for a minute because it will want to spring back.
If you need a threaded fitting where it comes out, you can substitute a threaded adapter for the coupling.
Now you can fix the plumbing from the new coupling or fitting.