This is the way it works. AE relays on RAM preview so the amount of RAM of your coomputer is the limit for previewing. What you can do is to reduce the resolution of your composition panel to get more seconds on your preview. Playback does not work as Premiere where the software access directly to the file and preview it in real-time. After Effects needs to cache all frames for playback.
Check the Preview options in the Preview Panel. You can select Move To Preview Time if you want the CTI (current time indicator) to stop when you press the Space Bar again. The length of the Ram Preview depends on the Comp frame rate, frame size, number of effects, available system resources, comp resolution settings, and free space on your system. AE is not an NLE. Most of your comps should only contain one shot, and editing should be done in an NLE. Think of AE as a day on the set with a crew, one camera, and actors. You rehearse the closeup of your star, figure out how to light the scene, get the props where they need to be, set up the camera moves, then call Action. When the lines have been delivered, and you call cut, if the shot felt good (your ram preview), you stop shooting that scene and call out "Moving On." The cast and crew start setting up for the reverse, or the wide shot. You cut the shots together in the editing room to make your scene. You start cutting the final move when you have most of the scenes assembled. When you get the movie edited, you do the final sound mix and color correction. AE is not the editing room, the mixing studio, or the color correction facility; it is the crew and camera on location.